public final class ASCIIPropertyListParser extends Object
Parser for ASCII property lists. Supports Apple OS X/iOS and GnuStep/NeXTSTEP format. This parser is based on the recursive descent paradigm, but the underlying grammar is not explicitly defined.
Resources on ASCII property list format:
| Modifier and Type | Field and Description |
|---|---|
static char |
ARRAY_BEGIN_TOKEN
The token marking the beginning of an array.
|
static char |
ARRAY_END_TOKEN
The token marking the end of an array.
|
static char |
ARRAY_ITEM_DELIMITER_TOKEN
The token marking the end of an array element.
|
static char |
COMMENT_BEGIN_TOKEN
The token marking the beginning of a comment.
|
static char |
DATA_BASE64_BEGIN_TOKEN
The token marking the beginning of a data element in Base-64 encoding.
|
static char |
DATA_BASE64_END_TOKEN
The token marking the end of a data element in Base-64 encoding.
|
static char |
DATA_BEGIN_TOKEN
The token marking the beginning of a data element.
|
static char |
DATA_END_TOKEN
The token marking the end of a data element.
|
static char |
DATA_GSBOOL_BEGIN_TOKEN
The token marking the beginning of a GnuStep boolean value.
|
static char |
DATA_GSBOOL_FALSE_TOKEN
The token representing the boolean value
false in the GnuStep format. |
static char |
DATA_GSBOOL_TRUE_TOKEN
The token representing the boolean value
true in the GnuStep format. |
static char |
DATA_GSDATE_BEGIN_TOKEN
The token marking the beginning of a GnuStep date.
|
static char |
DATA_GSINT_BEGIN_TOKEN
The token marking the beginning of a GnuStep integer value.
|
static char |
DATA_GSOBJECT_BEGIN_TOKEN
The token marking the beginning of a GnuStep object.
|
static char |
DATA_GSREAL_BEGIN_TOKEN
The token marking the beginning of a GnuStep real value.
|
static char |
DATE_APPLE_DATE_TIME_DELIMITER
The token that marks the beginning of the time zone in the Apple format.
|
static char |
DATE_APPLE_END_TOKEN
The token that marks the end of the time zone in the Apple format.
|
static char |
DATE_DATE_FIELD_DELIMITER
The token that separates the parts of a date value (year, month and day).
|
static char |
DATE_GS_DATE_TIME_DELIMITER
The token that separates the date and time in the GnuStep format.
|
static char |
DATE_TIME_FIELD_DELIMITER
The token that separates the parts of a time value (hour, minute and second).
|
static char |
DICTIONARY_ASSIGN_TOKEN
The token marking the assignment of a value to a dictionary key.
|
static char |
DICTIONARY_BEGIN_TOKEN
The token marking the beginning of a dictionary.
|
static char |
DICTIONARY_END_TOKEN
The token marking the end of a dictionary.
|
static char |
DICTIONARY_ITEM_DELIMITER_TOKEN
The token marking the end of a dictionary entry.
|
static char |
MULTILINE_COMMENT_END_TOKEN
The token marking the end of a multi-line comment.
|
static char |
MULTILINE_COMMENT_SECOND_TOKEN
The token marking a comment to be multi-line.
|
static char |
QUOTEDSTRING_BEGIN_TOKEN
The token marking the beginning of a quoted string.
|
static char |
QUOTEDSTRING_END_TOKEN
The token marking the end of a quoted string.
|
static char |
QUOTEDSTRING_ESCAPE_TOKEN
The token marking the beginning of an escape sequence in a quoted string.
|
static char |
SINGLELINE_COMMENT_SECOND_TOKEN
The token marking a comment to be single-line.
|
static char |
WHITESPACE_CARRIAGE_RETURN
The carriage return character token.
|
static char |
WHITESPACE_NEWLINE
The newline character token.
|
static char |
WHITESPACE_SPACE
The space character token.
|
static char |
WHITESPACE_TAB
The tab character token.
|
| Modifier and Type | Method and Description |
|---|---|
NSObject |
parse()
Parses the property list from the beginning and returns the root object of the property list.
|
static NSObject |
parse(byte[] bytes)
Parses an ASCII property list from a byte array.
|
static NSObject |
parse(byte[] bytes,
String encoding)
Parses an ASCII property list from a byte array.
|
static NSObject |
parse(File f)
Parses an ASCII property list file.
|
static NSObject |
parse(File f,
String encoding)
Parses an ASCII property list file.
|
static NSObject |
parse(InputStream in)
Parses an ASCII property list from an input stream.
|
static NSObject |
parse(InputStream in,
String encoding)
Parses an ASCII property list from an input stream.
|
static NSObject |
parse(Path path)
Parses an ASCII property list file.
|
static NSObject |
parse(Path path,
String encoding)
Parses an ASCII property list file.
|
static NSObject |
parse(Reader reader)
Parses an ASCII property list from a
Reader. |
static NSObject |
parse(String plistData)
Parses an ASCII property list from a
String |
public static final char WHITESPACE_SPACE
public static final char WHITESPACE_TAB
public static final char WHITESPACE_NEWLINE
public static final char WHITESPACE_CARRIAGE_RETURN
public static final char ARRAY_BEGIN_TOKEN
public static final char ARRAY_END_TOKEN
public static final char ARRAY_ITEM_DELIMITER_TOKEN
public static final char DICTIONARY_BEGIN_TOKEN
public static final char DICTIONARY_END_TOKEN
public static final char DICTIONARY_ASSIGN_TOKEN
public static final char DICTIONARY_ITEM_DELIMITER_TOKEN
public static final char QUOTEDSTRING_BEGIN_TOKEN
public static final char QUOTEDSTRING_END_TOKEN
public static final char QUOTEDSTRING_ESCAPE_TOKEN
public static final char DATA_BEGIN_TOKEN
public static final char DATA_END_TOKEN
public static final char DATA_BASE64_BEGIN_TOKEN
public static final char DATA_BASE64_END_TOKEN
public static final char DATA_GSOBJECT_BEGIN_TOKEN
public static final char DATA_GSDATE_BEGIN_TOKEN
public static final char DATA_GSBOOL_BEGIN_TOKEN
public static final char DATA_GSBOOL_TRUE_TOKEN
true in the GnuStep format.public static final char DATA_GSBOOL_FALSE_TOKEN
false in the GnuStep format.public static final char DATA_GSINT_BEGIN_TOKEN
public static final char DATA_GSREAL_BEGIN_TOKEN
public static final char DATE_DATE_FIELD_DELIMITER
public static final char DATE_TIME_FIELD_DELIMITER
public static final char DATE_GS_DATE_TIME_DELIMITER
public static final char DATE_APPLE_DATE_TIME_DELIMITER
public static final char DATE_APPLE_END_TOKEN
public static final char COMMENT_BEGIN_TOKEN
public static final char MULTILINE_COMMENT_SECOND_TOKEN
public static final char SINGLELINE_COMMENT_SECOND_TOKEN
public static final char MULTILINE_COMMENT_END_TOKEN
MULTILINE_COMMENT_SECOND_TOKEN.public static NSObject parse(File f) throws IOException, ParseException
f - The ASCII property list file.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input stream.public static NSObject parse(File f, String encoding) throws IOException, ParseException
f - The ASCII property list file.encoding - The name of a supported charset to decode the
property list.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input
stream.UnsupportedEncodingException - If no support for the named charset is available
in this instance of the Java virtual machine.public static NSObject parse(Path path, String encoding) throws IOException, ParseException
path - The path to the ASCII property list file.encoding - The name of a supported charset to decode the
property list.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input
stream.UnsupportedEncodingException - If no support for the named charset is available
in this instance of the Java virtual machine.public static NSObject parse(Path path) throws IOException, ParseException
path - The path to the ASCII property list file.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input stream.public static NSObject parse(InputStream in) throws ParseException, IOException
in - The input stream that provides the property list's data.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input stream.public static NSObject parse(InputStream in, String encoding) throws ParseException, IOException
in - The input stream that points to the property list's data.encoding - The name of a supported charset to decode the
property list.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input
stream.UnsupportedEncodingException - If no support for the named charset is available
in this instance of the Java virtual machine.public static NSObject parse(Reader reader) throws ParseException, IOException
Reader. This method does not close the specified
reader.reader - The reader that provides the property list's data.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.IOException - If an error occurs while reading from the input reader.public static NSObject parse(String plistData) throws ParseException
StringplistData - A string containing the property list's data.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.public static NSObject parse(byte[] bytes) throws ParseException
bytes - The ASCII property list data.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.public static NSObject parse(byte[] bytes, String encoding) throws ParseException, UnsupportedEncodingException
bytes - The ASCII property list data.encoding - The name of a supported Charset charset to decode the
property list.NSDictionary but can
also be a NSArray.ParseException - If an error occurs during parsing.UnsupportedEncodingException - If no support for the named charset is available
in this instance of the Java virtual machine.public NSObject parse() throws ParseException
ParseException - If an error occurred during parsingCopyright © 2024. All rights reserved.