public 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 explicitely defined.
Resources on ASCII property list format:
Modifier | Constructor and Description |
---|---|
protected |
ASCIIPropertyListParser()
Only allow subclasses to change instantiation.
|
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(File f)
Parses an ASCII property list file.
|
static NSObject |
parse(InputStream in)
Parses an ASCII property list from an input stream.
|
static String |
parseQuotedString(String s)
Parses a string according to the format specified for ASCII property lists.
|
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_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
public static final char DATA_GSBOOL_FALSE_TOKEN
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
protected ASCIIPropertyListParser()
public static NSObject parse(File f) throws IOException, ParseException
f
- The ASCII property list file.ParseException
- When an error occurs during parsing.IOException
- When an error occured while reading from the input stream.public static NSObject parse(InputStream in) throws ParseException, IOException
in
- The input stream that points to the property list's data.ParseException
- When an error occurs during parsing.IOException
- When an error occured while reading from the input stream.public static NSObject parse(byte[] bytes) throws ParseException
bytes
- The ASCII property list data.ParseException
- When an error occurs during parsing.public NSObject parse() throws ParseException
ParseException
- When an error occured during parsingpublic static String parseQuotedString(String s) throws UnsupportedEncodingException, CharacterCodingException
s
- The escaped string according to the ASCII property list format, without leading and trailing quotation marks.UnsupportedEncodingException
- If the en-/decoder for the UTF-8 or ASCII encoding could not be loadedCharacterCodingException
- If the string is encoded neither in ASCII nor in UTF-8Copyright © 2014. All Rights Reserved.