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 | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| public static final char | ARRAY_BEGIN_TOKEN
The token marking the beginning of an array. |
| public static final char | ARRAY_END_TOKEN
The token marking the end of an array. |
| public static final char | ARRAY_ITEM_DELIMITER_TOKEN
The token marking the end of an array element. |
| public static final char | COMMENT_BEGIN_TOKEN
The token marking the beginning of a comment. |
| private final char[] | data
Property list source data |
| public static final char | DATA_BASE64_BEGIN_TOKEN
The token marking the beginning of a data element in Base-64 encoding. |
| public static final char | DATA_BASE64_END_TOKEN
The token marking the end of a data element in Base-64 encoding. |
| public static final char | DATA_BEGIN_TOKEN
The token marking the beginning of a data element. |
| public static final char | DATA_END_TOKEN
The token marking the end of a data element. |
| public static final char | DATA_GSBOOL_BEGIN_TOKEN
The token marking the beginning of a GnuStep boolean value. |
| public static final char | DATA_GSBOOL_FALSE_TOKEN
The token representing the boolean value |
| public static final char | DATA_GSBOOL_TRUE_TOKEN
The token representing the boolean value |
| public static final char | DATA_GSDATE_BEGIN_TOKEN
The token marking the beginning of a GnuStep date. |
| public static final char | DATA_GSINT_BEGIN_TOKEN
The token marking the beginning of a GnuStep integer value. |
| public static final char | DATA_GSOBJECT_BEGIN_TOKEN
The token marking the beginning of a GnuStep object. |
| public static final char | DATA_GSREAL_BEGIN_TOKEN
The token marking the beginning of a GnuStep real value. |
| public static final char | DATE_APPLE_DATE_TIME_DELIMITER
The token that marks the beginning of the time zone in the Apple format. |
| public static final char | DATE_APPLE_END_TOKEN
The token that marks the end of the time zone in the Apple format. |
| public static final char | DATE_DATE_FIELD_DELIMITER
The token that separates the parts of a date value (year, month and day). |
| public static final char | DATE_GS_DATE_TIME_DELIMITER
The token that separates the date and time in the GnuStep format. |
| public static final char | DATE_TIME_FIELD_DELIMITER
The token that separates the parts of a time value (hour, minute and second). |
| public static final char | DICTIONARY_ASSIGN_TOKEN
The token marking the assignment of a value to a dictionary key. |
| public static final char | DICTIONARY_BEGIN_TOKEN
The token marking the beginning of a dictionary. |
| public static final char | DICTIONARY_END_TOKEN
The token marking the end of a dictionary. |
| public static final char | DICTIONARY_ITEM_DELIMITER_TOKEN
The token marking the end of a dictionary entry. |
| private int | index
Current parsing index |
| private int | lineBeginning
The index at which the current line began. |
| private int | lineNo
Current line number. |
| public static final char | MULTILINE_COMMENT_END_TOKEN
The token marking the end of a multi-line comment. |
| public static final char | MULTILINE_COMMENT_SECOND_TOKEN
The token marking a comment to be multi-line. |
| public static final char | QUOTEDSTRING_BEGIN_TOKEN
The token marking the beginning of a quoted string. |
| public static final char | QUOTEDSTRING_END_TOKEN
The token marking the end of a quoted string. |
| public static final char | QUOTEDSTRING_ESCAPE_TOKEN
The token marking the beginning of an escape sequence in a quoted string. |
| public static final char | SINGLELINE_COMMENT_SECOND_TOKEN
The token marking a comment to be single-line. |
| public static final char | WHITESPACE_CARRIAGE_RETURN
The carriage return character token. |
| public static final char | WHITESPACE_NEWLINE
The newline character token. |
| public static final char | WHITESPACE_SPACE
The space character token. |
| public static final char | WHITESPACE_TAB
The tab character token. |
| Access | Constructor and Description |
|---|---|
| private | ASCIIPropertyListParser(byte[]
The content of the property list that is to be parsed. propertyListContent, String The name of a supported encoding)charset to
decode the property list.Creates a new parser for the given property list content. |
| private | ASCIIPropertyListParser(char[]
The content of the property list that is to be parsed. propertyListContent)Creates a new parser for the given property list content. |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: Whether one of the symbols can be accepted or not.The symbols to check. acceptableSymbols)Checks whether the given symbols can be accepted, that is, if one of the given symbols is found at the current parsing position. |
| private boolean | Returns: Whether the symbol can be accepted or not.The symbol to check. acceptableSymbol)Checks whether the given symbol can be accepted, that is, if the given symbols is found at the current parsing position. |
| private boolean | Returns: Whether the given tokens occur at the current parsing position.The sequence of tokens to look for. sequence)Checks whether the given sequence of symbols can be accepted. |
| private ParseException | |
| private ParseException | |
| private void | expect(char...
The expected symbols. expectedSymbols)Expects the input to have one of the given symbols at the current parsing position. |
| private void | expect(char
The expected symbol. expectedSymbol)Expects the input to have the given symbol at the current parsing position. |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The ASCII property list file. f)Parses an ASCII property list file. |
| public static NSObject | |
| public static NSObject | |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The path to the ASCII property list file. path)Parses an ASCII property list file. |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The input stream that provides the property list's data. in)Parses an ASCII property list from an input stream. |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The input stream that points to the property list's data. in, String The name of a supported encoding)charset to decode the
property list.Parses an ASCII property list from an input stream. |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The reader that provides the property list's data. reader)Parses an ASCII property list from a |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.A string containing the property list's data. plistData)Parses an ASCII property list from a |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The ASCII property list data. bytes)Parses an ASCII property list from a byte array. |
| public static NSObject | Returns: The root object of the property list. This is usually aNSDictionary but can
also be a NSArray.The ASCII property list data. bytes, String The name of a supported encoding)java. charset to decode the
property list.Parses an ASCII property list from a byte array. |
| public NSObject | Returns: The root object of the property list. This can either be a NSDictionary or a NSArray.Parses the property list from the beginning and returns the root object of the property list. |
| private NSArray | Returns: The array found at the parsing position.Parses an array from the current parsing position. |
| private NSObject | Returns: The data object found at the parsing position.Parses a data object from the current parsing position. |
| private NSObject | Returns: An NSDate if the string represents such an object. Otherwise, an NSString is returned.Attempts to parse a plain string as a date if possible. |
| private NSDictionary | Returns: The dictionary found at the parsing position.Parses a dictionary from the current parsing position. |
| private NSObject | Returns: The parsed NSObject.Parses the NSObject found at the current position in the property list data stream. |
| private String | Returns: The quoted string found at the parsing method with all special characters unescaped.Parses a quoted string from the current parsing position. |
| private String | Returns: The string found at the current parsing position.Parses a plain string from the current parsing position. |
| private void | |
| private String | Returns: The input until one the given symbols.The symbols that can occur after the string to read. symbols)Reads input until one of the given symbols is found. |
| private String | Returns: The input until the given symbol.The symbol that can occur after the string to read. symbol)Reads input until the given symbol is found. |
| private void | |
| private void | |
| private void | skipWhitespacesAndComments()
Skips all whitespaces and comments from the current parsing position onward. |
| private void |
| ARRAY_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char ARRAY_BEGIN_TOKEN The token marking the beginning of an array. | |
| ARRAY_END_TOKEN | back to summary |
|---|---|
| public static final char ARRAY_END_TOKEN The token marking the end of an array. | |
| ARRAY_ITEM_DELIMITER_TOKEN | back to summary |
|---|---|
| public static final char ARRAY_ITEM_DELIMITER_TOKEN The token marking the end of an array element. | |
| COMMENT_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char COMMENT_BEGIN_TOKEN The token marking the beginning of a comment. | |
| data | back to summary |
|---|---|
| private final char[] data Property list source data | |
| DATA_BASE64_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_BASE64_BEGIN_TOKEN The token marking the beginning of a data element in Base-64 encoding. | |
| DATA_BASE64_END_TOKEN | back to summary |
|---|---|
| public static final char DATA_BASE64_END_TOKEN The token marking the end of a data element in Base-64 encoding. | |
| DATA_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_BEGIN_TOKEN The token marking the beginning of a data element. | |
| DATA_END_TOKEN | back to summary |
|---|---|
| public static final char DATA_END_TOKEN The token marking the end of a data element. | |
| DATA_GSBOOL_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSBOOL_BEGIN_TOKEN The token marking the beginning of a GnuStep boolean value. | |
| DATA_GSBOOL_FALSE_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSBOOL_FALSE_TOKEN The token representing the boolean value | |
| DATA_GSBOOL_TRUE_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSBOOL_TRUE_TOKEN The token representing the boolean value | |
| DATA_GSDATE_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSDATE_BEGIN_TOKEN The token marking the beginning of a GnuStep date. | |
| DATA_GSINT_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSINT_BEGIN_TOKEN The token marking the beginning of a GnuStep integer value. | |
| DATA_GSOBJECT_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSOBJECT_BEGIN_TOKEN The token marking the beginning of a GnuStep object. | |
| DATA_GSREAL_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DATA_GSREAL_BEGIN_TOKEN The token marking the beginning of a GnuStep real value. | |
| DATE_APPLE_DATE_TIME_DELIMITER | back to summary |
|---|---|
| public static final char DATE_APPLE_DATE_TIME_DELIMITER The token that marks the beginning of the time zone in the Apple format. | |
| DATE_APPLE_END_TOKEN | back to summary |
|---|---|
| public static final char DATE_APPLE_END_TOKEN The token that marks the end of the time zone in the Apple format. | |
| DATE_DATE_FIELD_DELIMITER | back to summary |
|---|---|
| public static final char DATE_DATE_FIELD_DELIMITER The token that separates the parts of a date value (year, month and day). | |
| DATE_GS_DATE_TIME_DELIMITER | back to summary |
|---|---|
| public static final char DATE_GS_DATE_TIME_DELIMITER The token that separates the date and time in the GnuStep format. | |
| DATE_TIME_FIELD_DELIMITER | back to summary |
|---|---|
| public static final char DATE_TIME_FIELD_DELIMITER The token that separates the parts of a time value (hour, minute and second). | |
| DICTIONARY_ASSIGN_TOKEN | back to summary |
|---|---|
| public static final char DICTIONARY_ASSIGN_TOKEN The token marking the assignment of a value to a dictionary key. | |
| DICTIONARY_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char DICTIONARY_BEGIN_TOKEN The token marking the beginning of a dictionary. | |
| DICTIONARY_END_TOKEN | back to summary |
|---|---|
| public static final char DICTIONARY_END_TOKEN The token marking the end of a dictionary. | |
| DICTIONARY_ITEM_DELIMITER_TOKEN | back to summary |
|---|---|
| public static final char DICTIONARY_ITEM_DELIMITER_TOKEN The token marking the end of a dictionary entry. | |
| index | back to summary |
|---|---|
| private int index Current parsing index | |
| lineBeginning | back to summary |
|---|---|
| private int lineBeginning The index at which the current line began. | |
| lineNo | back to summary |
|---|---|
| private int lineNo Current line number. | |
| MULTILINE_COMMENT_END_TOKEN | back to summary |
|---|---|
| public static final char MULTILINE_COMMENT_END_TOKEN The token marking the end of a multi-line comment. Must be preceded by a
| |
| MULTILINE_COMMENT_SECOND_TOKEN | back to summary |
|---|---|
| public static final char MULTILINE_COMMENT_SECOND_TOKEN The token marking a comment to be multi-line. | |
| QUOTEDSTRING_BEGIN_TOKEN | back to summary |
|---|---|
| public static final char QUOTEDSTRING_BEGIN_TOKEN The token marking the beginning of a quoted string. | |
| QUOTEDSTRING_END_TOKEN | back to summary |
|---|---|
| public static final char QUOTEDSTRING_END_TOKEN The token marking the end of a quoted string. | |
| QUOTEDSTRING_ESCAPE_TOKEN | back to summary |
|---|---|
| public static final char QUOTEDSTRING_ESCAPE_TOKEN The token marking the beginning of an escape sequence in a quoted string. | |
| SINGLELINE_COMMENT_SECOND_TOKEN | back to summary |
|---|---|
| public static final char SINGLELINE_COMMENT_SECOND_TOKEN The token marking a comment to be single-line. | |
| WHITESPACE_CARRIAGE_RETURN | back to summary |
|---|---|
| public static final char WHITESPACE_CARRIAGE_RETURN The carriage return character token. | |
| WHITESPACE_NEWLINE | back to summary |
|---|---|
| public static final char WHITESPACE_NEWLINE The newline character token. | |
| WHITESPACE_SPACE | back to summary |
|---|---|
| public static final char WHITESPACE_SPACE The space character token. | |
| WHITESPACE_TAB | back to summary |
|---|---|
| public static final char WHITESPACE_TAB The tab character token. | |
| ASCIIPropertyListParser | back to summary |
|---|---|
| private ASCIIPropertyListParser(byte[] propertyListContent, String encoding) throws UnsupportedEncodingException Creates a new parser for the given property list content.
| |
| ASCIIPropertyListParser | back to summary |
|---|---|
| private ASCIIPropertyListParser(char[] propertyListContent) Creates a new parser for the given property list content.
| |
| accept | back to summary |
|---|---|
| private boolean accept(char... acceptableSymbols) Checks whether the given symbols can be accepted, that is, if one of the given symbols is found at the current parsing position.
| |
| accept | back to summary |
|---|---|
| private boolean accept(char acceptableSymbol) Checks whether the given symbol can be accepted, that is, if the given symbols is found at the current parsing position.
| |
| acceptSequence | back to summary |
|---|---|
| private boolean acceptSequence(char... sequence) Checks whether the given sequence of symbols can be accepted.
| |
| createParseException | back to summary |
|---|---|
| private ParseException createParseException(String message) | |
| createParseException | back to summary |
|---|---|
| private ParseException createParseException(String message, int index) | |
| expect | back to summary |
|---|---|
| private void expect(char... expectedSymbols) throws ParseException Expects the input to have one of the given symbols at the current parsing position.
| |
| expect | back to summary |
|---|---|
| private void expect(char expectedSymbol) throws ParseException Expects the input to have the given symbol at the current parsing position.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(File f) throws IOException, ParseException Parses an ASCII property list file.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(File f, String encoding) throws IOException, ParseException Parses an ASCII property list file.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(Path path, String encoding) throws IOException, ParseException Parses an ASCII property list file.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(Path path) throws IOException, ParseException Parses an ASCII property list file.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(InputStream in) throws ParseException, IOException Parses an ASCII property list from an input stream. This method does not close the specified input stream.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(InputStream in, String encoding) throws ParseException, IOException Parses an ASCII property list from an input stream. This method does not close the specified input stream.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(Reader reader) throws ParseException, IOException Parses an ASCII property list from a
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(String plistData) throws ParseException Parses an ASCII property list from a
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(byte[] bytes) throws ParseException Parses an ASCII property list from a byte array.
| |
| parse | back to summary |
|---|---|
| public static NSObject parse(byte[] bytes, String encoding) throws ParseException, UnsupportedEncodingException Parses an ASCII property list from a byte array.
| |
| parse | back to summary |
|---|---|
| public NSObject parse() throws ParseException Parses the property list from the beginning and returns the root object of the property list.
| |
| parseArray | back to summary |
|---|---|
| private NSArray parseArray() throws ParseException Parses an array from the current parsing position. The prerequisite for calling this method is, that an array begin token has been read.
| |
| parseData | back to summary |
|---|---|
| private NSObject parseData() throws ParseException Parses a data object from the current parsing position. This can either be a NSData object or a GnuStep NSNumber or NSDate. The prerequisite for calling this method is, that a data begin token has been read.
| |
| parseDateString | back to summary |
|---|---|
| private NSObject parseDateString() Attempts to parse a plain string as a date if possible.
| |
| parseDictionary | back to summary |
|---|---|
| private NSDictionary parseDictionary() throws ParseException Parses a dictionary from the current parsing position. The prerequisite for calling this method is, that a dictionary begin token has been read.
| |
| parseObject | back to summary |
|---|---|
| private NSObject parseObject() throws ParseException Parses the NSObject found at the current position in the property list data stream.
| |
| parseQuotedString | back to summary |
|---|---|
| private String parseQuotedString() throws ParseException Parses a quoted string from the current parsing position. The prerequisite for calling this method is, that a quoted string begin token has been read.
| |
| parseString | back to summary |
|---|---|
| private String parseString() Parses a plain string from the current parsing position. The string is made up of all characters to the next whitespace, delimiter token or assignment token.
| |
| read | back to summary |
|---|---|
| private void read(char symbol) throws ParseException Reads an expected symbol.
| |
| readInputUntil | back to summary |
|---|---|
| private String readInputUntil(char... symbols) Reads input until one of the given symbols is found.
| |
| readInputUntil | back to summary |
|---|---|
| private String readInputUntil(char symbol) Reads input until the given symbol is found.
| |
| skip | back to summary |
|---|---|
| private void skip() Skips the current symbol. | |
| skip | back to summary |
|---|---|
| private void skip(int numSymbols) Skips several symbols
| |
| skipWhitespacesAndComments | back to summary |
|---|---|
| private void skipWhitespacesAndComments() Skips all whitespaces and comments from the current parsing position onward. | |
| trackLineBreak | back to summary |
|---|---|
| private void trackLineBreak() | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final StringBuilder | |
| private StringBuilder | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private boolean | |
| public boolean | |
| private boolean | |
| private boolean |
| startIndex | back to summary |
|---|---|
| private final int startIndex | |
| stringBuilder | back to summary |
|---|---|
| private final StringBuilder stringBuilder | |
| unicodeReference | back to summary |
|---|---|
| private StringBuilder unicodeReference | |
| unicodeReferenceRadix | back to summary |
|---|---|
| private int unicodeReferenceRadix | |
| EscapeSequenceHandler | back to summary |
|---|---|
| public EscapeSequenceHandler(StringBuilder stringBuilder) | |
| handleEndOfString | back to summary |
|---|---|
| public void handleEndOfString() throws ParseException | |
| handleFirstChar | back to summary |
|---|---|
| private boolean handleFirstChar(char c) throws ParseException | |
| handleNextChar | back to summary |
|---|---|
| public boolean handleNextChar(char c) throws ParseException | |
| handleNextCharOfHexEscapeSequence | back to summary |
|---|---|
| private boolean handleNextCharOfHexEscapeSequence(char c) throws ParseException | |
| handleNextCharOfOctalEscapeSequence | back to summary |
|---|---|
| private boolean handleNextCharOfOctalEscapeSequence(char c) throws ParseException | |