public abstract class PropertyListParser
extends java.lang.Object
NSObjects| Constructor and Description |
|---|
PropertyListParser(java.io.InputStream input)
Construct a new PropertyListParser which will parse a InputStream
|
| Modifier and Type | Method and Description |
|---|---|
static PropertyListFormat |
getFormatForFile(java.io.File file)
Get the format for a Property List file.
|
static PropertyListFormat |
getFormatForFile(java.io.File file,
boolean cacheOnly)
Get the format for a Property List file.
|
abstract NSObject |
parse()
Parse the Property List input (provided in the constructor) to a tree of
NSObjects |
static NSObject |
parse(java.io.File file)
Parse a Property List file.
|
static NSObject |
parse(java.io.InputStream input)
Parse a Property List InputStream.
|
public PropertyListParser(java.io.InputStream input)
input - the InputStream to parsepublic abstract NSObject parse() throws PropertyListException
NSObjectsNSObject of the parsed Property ListPropertyListException - when parsing the Property List failedpublic static PropertyListFormat getFormatForFile(java.io.File file)
file - The file which format must be determined.public static PropertyListFormat getFormatForFile(java.io.File file, boolean cacheOnly)
file - The file which format must be determined.cacheOnly - Do not find out which format a file has if it is not in the cache yet but return null instead.public static NSObject parse(java.io.File file) throws PropertyListException, java.io.IOException
file - the file to parseNSObject of the parsed Property ListPropertyListException - when parsing the file failedjava.io.IOException - when reading the file failedpublic static NSObject parse(java.io.InputStream input) throws PropertyListException, java.io.IOException
Parse a Property List InputStream.
It is recommended to use an implementation where InputStream.markSupported() returns true.
InputStreams not meeting this recommendation will be wrapped inside a BufferedInputStream, which does.
Mark is required to make it possible to try multiple parsing methods without consuming the InputStream.
Warning: This method will not explicitly close the InputStream.
You will have to close the stream yourself by calling InputStream.close() after parse(InputStream).
input - the InputStream to parse (instance with mark support recommended)NSObject of the parsed property listPropertyListException - when parsing the input failedjava.io.IOException - when reading the input failed