public class XMLPropertyListParser extends Object
Constructor and Description |
---|
XMLPropertyListParser() |
Modifier and Type | Method and Description |
---|---|
static DocumentBuilder |
getDocBuilder()
Gets a
DocumentBuilder to parse a XML property list. |
static NSObject |
parse(byte[] bytes)
Parses a XML property list from a byte array.
|
static NSObject |
parse(Document doc)
Parses a property list from an XML document.
|
static NSObject |
parse(File f)
Parses a XML property list file.
|
static NSObject |
parse(InputStream is)
Parses a XML property list from an input stream.
|
public static DocumentBuilder getDocBuilder() throws ParserConfigurationException
DocumentBuilder
to parse a XML property list.
As DocumentBuilder
iinstance are not thread-safe a new DocumentBuilder
is generated for each request.DocumentBuilder
that can parse property lists without an internet connection.ParserConfigurationException
- If a document builder for parsing a XML property list
could not be created. This should not occur.public static NSObject parse(File f) throws ParserConfigurationException, IOException, SAXException, PropertyListFormatException, ParseException
f
- The XML property list file.NSDictionary
but can also be a NSArray
.ParserConfigurationException
- If a document builder for parsing a XML property list
could not be created. This should not occur.IOException
- If any I/O error occurs while reading the file.SAXException
- If any parse error occurs.PropertyListFormatException
- If the given property list has an invalid format.ParseException
- If a date string could not be parsed.DocumentBuilder.parse(java.io.File)
public static NSObject parse(byte[] bytes) throws ParserConfigurationException, ParseException, SAXException, PropertyListFormatException, IOException
bytes
- The byte array containing the property list's data.NSDictionary
but can also be a NSArray
.ParserConfigurationException
- If a document builder for parsing a XML property list
could not be created. This should not occur.IOException
- If any I/O error occurs while reading the file.SAXException
- If any parse error occurs.PropertyListFormatException
- If the given property list has an invalid format.ParseException
- If a date string could not be parsed.public static NSObject parse(InputStream is) throws ParserConfigurationException, IOException, SAXException, PropertyListFormatException, ParseException
is
- The input stream pointing to the property list's data.NSDictionary
but can also be a NSArray
.ParserConfigurationException
- If a document builder for parsing a XML property list
could not be created. This should not occur.IOException
- If any I/O error occurs while reading the file.SAXException
- If any parse error occurs.PropertyListFormatException
- If the given property list has an invalid format.ParseException
- If a date string could not be parsed.DocumentBuilder.parse(java.io.InputStream)
public static NSObject parse(Document doc) throws PropertyListFormatException, IOException, ParseException
doc
- The XML document.IOException
- If any I/O error occurs while reading the file.PropertyListFormatException
- If the given property list has an invalid format.ParseException
- If a date string could not be parsed.Copyright © 2019. All rights reserved.