public abstract class PropertyListWriter
extends java.lang.Object
NSObject
s to a property list.Modifier and Type | Class and Description |
---|---|
static class |
PropertyListWriter.Format
Consists of possible output formats
|
Modifier and Type | Field and Description |
---|---|
static PropertyListWriter.Format |
defaultFormat
The default format used when
write(NSObject, File) is called. |
protected NSObject |
root
The root object of the tree
|
Constructor and Description |
---|
PropertyListWriter(NSObject root)
Construct a new PropertyListWriter
|
Modifier and Type | Method and Description |
---|---|
static void |
write(NSObject root,
java.io.File file)
Convert a tree to a property list and write it to a stream
|
static void |
write(NSObject root,
java.io.File file,
PropertyListWriter.Format format)
Convert a tree to a property list and write it to a file
|
static void |
write(NSObject root,
java.io.OutputStream stream,
PropertyListWriter.Format format)
Convert a tree to a property list and write it to a stream
|
abstract void |
write(java.io.OutputStream stream)
Write the property list to a stream
|
public static PropertyListWriter.Format defaultFormat
write(NSObject, File)
is called.
This usually is PropertyListWriter.Format.BINARY
on Mac OS X or PropertyListWriter.Format.XML
on other operating systems,
but might differ since this field is not final.
If you need a specific format you should not rely on the contents of this field to stay the same.
Instead you should specify the format as an argument in the write(NSObject, File, Format)
method.
If you do not need a specific format then it is safe to use the write(OutputStream)
method without PropertyListWriter.Format
argument.protected final NSObject root
public PropertyListWriter(NSObject root)
root
- the root of the treepublic abstract void write(java.io.OutputStream stream) throws PropertyListException, java.io.IOException
stream
- the stream to write the property list toPropertyListException
- when generating the property list failsjava.io.IOException
- when writing to the stream failspublic static void write(NSObject root, java.io.OutputStream stream, PropertyListWriter.Format format) throws PropertyListException, java.io.IOException
root
- the root of the treestream
- the stream to write the property list toformat
- the format to use when writingPropertyListException
- when generating the property list failsParserConfigurationException
- when unable to create an XML documentjava.io.IOException
- when writing to the stream failspublic static void write(NSObject root, java.io.File file) throws PropertyListException, java.io.IOException
PropertyListException
java.io.IOException
write(NSObject, OutputStream, Format)
public static void write(NSObject root, java.io.File file, PropertyListWriter.Format format) throws PropertyListException, java.io.IOException
root
- the root of the treefile
- the file to write toformat
- the format to use when writingPropertyListException
- when generating the property list failsParserConfigurationException
- when unable to create an XML documentjava.io.IOException
- when writing to the stream fails