org.apache.avalon.framework.configuration
Class DefaultConfigurationSerializer

java.lang.Object
  extended byorg.apache.avalon.framework.configuration.DefaultConfigurationSerializer

public class DefaultConfigurationSerializer
extends java.lang.Object

A ConfigurationSerializer serializes configurations via SAX2 compliant parser.

Author:
Berin Loritsch

Constructor Summary
DefaultConfigurationSerializer()
          Build a ConfigurationSerializer
 
Method Summary
protected  javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
          Get the SAXTransformerFactory so we can get a serializer without being tied to one vendor.
protected  void serialize(Configuration source)
          Start the serialization process.
 void serialize(java.io.OutputStream outputStream, Configuration source)
          Serialize the configuration object to an output stream.
 void serialize(java.lang.String uri, Configuration source)
          Serialize the configuration object to an output stream derived from an URI.
protected  void serializeElement(Configuration element)
          Serialize each Configuration element.
 void serializeToFile(java.io.File file, Configuration source)
          Serialize the configuration object to a file using a File object.
 void serializeToFile(java.lang.String filename, Configuration source)
          Serialize the configuration object to a file using a filename.
protected  void setOutputStream(java.io.OutputStream out)
          Internally set the output strream we will be using.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConfigurationSerializer

public DefaultConfigurationSerializer()
Build a ConfigurationSerializer

Method Detail

setOutputStream

protected void setOutputStream(java.io.OutputStream out)
Internally set the output strream we will be using.


getTransformerFactory

protected javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
Get the SAXTransformerFactory so we can get a serializer without being tied to one vendor.


serialize

protected void serialize(Configuration source)
                  throws org.xml.sax.SAXException,
                         ConfigurationException
Start the serialization process. The output stream must be set before calling this method.

Throws:
org.xml.sax.SAXException
ConfigurationException

serializeElement

protected void serializeElement(Configuration element)
                         throws org.xml.sax.SAXException,
                                ConfigurationException
Serialize each Configuration element. This method is called recursively.

Throws:
org.xml.sax.SAXException
ConfigurationException

serializeToFile

public void serializeToFile(java.lang.String filename,
                            Configuration source)
                     throws org.xml.sax.SAXException,
                            java.io.IOException,
                            ConfigurationException
Serialize the configuration object to a file using a filename.

Throws:
org.xml.sax.SAXException
java.io.IOException
ConfigurationException

serializeToFile

public void serializeToFile(java.io.File file,
                            Configuration source)
                     throws org.xml.sax.SAXException,
                            java.io.IOException,
                            ConfigurationException
Serialize the configuration object to a file using a File object.

Throws:
org.xml.sax.SAXException
java.io.IOException
ConfigurationException

serialize

public void serialize(java.io.OutputStream outputStream,
                      Configuration source)
               throws org.xml.sax.SAXException,
                      java.io.IOException,
                      ConfigurationException
Serialize the configuration object to an output stream.

Throws:
org.xml.sax.SAXException
java.io.IOException
ConfigurationException

serialize

public void serialize(java.lang.String uri,
                      Configuration source)
               throws org.xml.sax.SAXException,
                      java.io.IOException,
                      ConfigurationException
Serialize the configuration object to an output stream derived from an URI. The URI must be resolveable by the java.net.URL object.

Throws:
org.xml.sax.SAXException
java.io.IOException
ConfigurationException


"Copyright ? 2001 Apache Jakarta Project. All Rights Reserved."