public class DOMXMLWriter extends PropertyListWriter
NSObject
s to an XML property listPropertyListWriter.Format
Modifier and Type | Field and Description |
---|---|
protected javax.xml.parsers.DocumentBuilder |
db
The DocumentBuilder
|
protected static javax.xml.parsers.DocumentBuilderFactory |
dbf
The DocumentBuilderFactory
|
protected org.w3c.dom.Document |
doc
The XML document
|
static java.lang.String |
DOCTYPE_PUBLIC
The public declaration of the document type
|
static java.lang.String |
DOCTYPE_SYSTEM
The URL of the document type
|
static java.lang.String |
VERSION
Version of this XML format
|
defaultFormat, root
Constructor and Description |
---|
DOMXMLWriter(NSObject root) |
Modifier and Type | Method and Description |
---|---|
protected org.w3c.dom.Element |
generateArray(NSArray array)
Convert an NSArray to an XML element
|
protected org.w3c.dom.Element |
generateBoolean(NSBoolean bool)
Convert an NSBoolean to an XML element
|
protected org.w3c.dom.Element |
generateData(NSData data)
Convert an NSData to an XML element
|
protected org.w3c.dom.Element |
generateDate(NSDate date)
Convert an NSDate to an XML element
|
protected org.w3c.dom.Element |
generateDictionary(NSDictionary dictionary)
Convert an NSDictionary to an XML element
|
protected org.w3c.dom.Element |
generateInteger(NSInteger integer)
Convert an NSInteger to an XML element
|
protected org.w3c.dom.Element |
generateKey(java.lang.String name)
Creates a key XML element
|
protected org.w3c.dom.Element |
generateNode(NSObject obj)
Convert an NSObject to an XML element
|
protected org.w3c.dom.Element |
generateReal(NSReal real)
Convert an NSReal to an XML element
|
protected org.w3c.dom.Element |
generateString(NSString string)
Convert an NSString to an XML element
|
void |
write(java.io.OutputStream stream)
Write the property list to a stream
|
void |
write(java.io.OutputStream stream,
boolean indent)
Convert a tree to a XML property list and write it to a stream
|
write, write, write
protected final org.w3c.dom.Document doc
protected static final javax.xml.parsers.DocumentBuilderFactory dbf
protected final javax.xml.parsers.DocumentBuilder db
public static final java.lang.String DOCTYPE_PUBLIC
public static final java.lang.String DOCTYPE_SYSTEM
public static final java.lang.String VERSION
public DOMXMLWriter(NSObject root)
public void write(java.io.OutputStream stream) throws org.w3c.dom.DOMException, PropertyListException, java.io.IOException
write
in class PropertyListWriter
stream
- the stream to write the property list toPropertyListException
- when generating the property list failsjava.io.IOException
- when writing to the stream failsorg.w3c.dom.DOMException
public void write(java.io.OutputStream stream, boolean indent) throws org.w3c.dom.DOMException, PropertyListException, java.io.IOException
stream
- the stream to write the property list toindent
- whether the resulting XML file should be indentedorg.w3c.dom.DOMException
- when an error occurred generating the XML documentPropertyListException
- when generating the property list failsjava.io.IOException
- if an I/O error occursprotected org.w3c.dom.Element generateNode(NSObject obj) throws PropertyListException
obj
- the NSObject to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateArray(NSArray array) throws org.w3c.dom.DOMException, PropertyListException
array
- the NSArray to convertPropertyListException
- when generating the property list failsorg.w3c.dom.DOMException
protected org.w3c.dom.Element generateBoolean(NSBoolean bool)
bool
- the NSBoolean to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateData(NSData data)
data
- the NSData to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateDate(NSDate date)
date
- the NSDate to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateDictionary(NSDictionary dictionary) throws org.w3c.dom.DOMException, PropertyListException
dictionary
- the NSDictionary to convertPropertyListException
- when generating the property list failsorg.w3c.dom.DOMException
protected org.w3c.dom.Element generateReal(NSReal real)
real
- the NSReal to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateInteger(NSInteger integer)
integer
- the NSInteger to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateString(NSString string)
string
- the NSString to convertPropertyListException
- when generating the property list failsprotected org.w3c.dom.Element generateKey(java.lang.String name)
name
- the name of the keyPropertyListException
- when generating the property list fails