net.sf.plist.io
Class PropertyListWriter

java.lang.Object
  extended by net.sf.plist.io.PropertyListWriter
Direct Known Subclasses:
DOMXMLWriter

public abstract class PropertyListWriter
extends Object

Serializes a tree consisting of NSObjects to a property list.


Nested Class Summary
static class PropertyListWriter.Format
          Consists of possible output formats
 
Field Summary
static PropertyListWriter.Format defaultFormat
          The format used when write(NSObject, File) is called
protected  NSObject root
          The root object of the tree
 
Constructor Summary
PropertyListWriter(NSObject root)
          Construct a new PropertyListWriter
 
Method Summary
static void write(NSObject root, File file)
          Convert a tree to a property list and write it to a stream
static void write(NSObject root, File file, PropertyListWriter.Format format)
          Convert a tree to a property list and write it to a file
static void write(NSObject root, OutputStream stream, PropertyListWriter.Format format)
          Convert a tree to a property list and write it to a stream
abstract  void write(OutputStream stream)
          Write the property list to a stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFormat

public static PropertyListWriter.Format defaultFormat
The format used when write(NSObject, File) is called


root

protected final NSObject root
The root object of the tree

Constructor Detail

PropertyListWriter

public PropertyListWriter(NSObject root)
Construct a new PropertyListWriter

Parameters:
root - the root of the tree
Method Detail

write

public abstract void write(OutputStream stream)
                    throws PropertyListException,
                           IOException
Write the property list to a stream

Parameters:
stream - the stream to write the property list to
Throws:
PropertyListException - when generating the property list fails
IOException - when writing to the stream fails

write

public static void write(NSObject root,
                         OutputStream stream,
                         PropertyListWriter.Format format)
                  throws PropertyListException,
                         ParserConfigurationException,
                         IOException
Convert a tree to a property list and write it to a stream

Parameters:
root - the root of the tree
stream - the stream to write the property list to
format - the format to use when writing
Throws:
PropertyListException - when generating the property list fails
ParserConfigurationException - when unable to create an XML document
IOException - when writing to the stream fails

write

public static void write(NSObject root,
                         File file)
                  throws PropertyListException,
                         ParserConfigurationException,
                         IOException
Convert a tree to a property list and write it to a stream

Throws:
PropertyListException
ParserConfigurationException
IOException
See Also:
write(NSObject, OutputStream, Format)

write

public static void write(NSObject root,
                         File file,
                         PropertyListWriter.Format format)
                  throws PropertyListException,
                         ParserConfigurationException,
                         IOException
Convert a tree to a property list and write it to a file

Parameters:
root - the root of the tree
file - the file to write to
format - the format to use when writing
Throws:
PropertyListException - when generating the property list fails
ParserConfigurationException - when unable to create an XML document
IOException - when writing to the stream fails