SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.meta
Class XMLMetaDataSerializer

java.lang.Object
  |
  +--com.solarmetric.rd.meta.XMLMetaDataSerializer
All Implemented Interfaces:
MetaDataSerializer
Direct Known Subclasses:
CFMetaDataSerializer, XMLSchemaSerializer

public abstract class XMLMetaDataSerializer
extends java.lang.Object
implements MetaDataSerializer

Abstract base type for serlializers that transfer groups of objects to XML. Includes a way of serializing objects back to the XML files they were parsed from.

Serializers are not thread safe.


Constructor Summary
XMLMetaDataSerializer()
           
 
Method Summary
protected  void addAttribute(java.lang.String name, java.lang.String value)
          Add an attribute to the current group.
protected  void endElement(java.lang.String name)
          End the current element.
 org.apache.commons.logging.Log getLog()
          Return the log to write to.
protected abstract  java.util.Collection getObjects()
          Return the current set of objects set for serialization.
protected  void reset()
          Reset serialization state for the next document.
 void serialize()
          Serialize the current set of objects to the files from which they were parsed.
protected abstract  void serialize(java.util.Collection objs)
          Serialize the given set of objects to the given handler.
 void serialize(org.xml.sax.ContentHandler handler)
          Serilize the current set of objects to a series of SAX events on the given handler.
 void serialize(java.io.File file, boolean append, boolean pretty)
          Serialize the current set of objects to the given file, optionally appending and pretty-printing.
 void serialize(javax.xml.transform.Result result)
          Serialize the current set of objects to the given result.
 void serialize(java.io.Writer out, boolean pretty)
          Serialize the current set of objects to the given stream, optionally pretty-printing the result.
 void setLog(org.apache.commons.logging.Log log)
          Set the log to write to.
protected  void startElement(java.lang.String name)
          Start an element with the current attribute settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLMetaDataSerializer

public XMLMetaDataSerializer()
Method Detail

getLog

public org.apache.commons.logging.Log getLog()
Description copied from interface: MetaDataSerializer
Return the log to write to.

Specified by:
getLog in interface MetaDataSerializer

setLog

public void setLog(org.apache.commons.logging.Log log)
Description copied from interface: MetaDataSerializer
Set the log to write to.

Specified by:
setLog in interface MetaDataSerializer

serialize

public void serialize()
               throws java.io.IOException
Description copied from interface: MetaDataSerializer
Serialize the current set of objects to the files from which they were parsed. The objects must implement the SourceTracker interface.

Specified by:
serialize in interface MetaDataSerializer
java.io.IOException

serialize

public void serialize(java.io.File file,
                      boolean append,
                      boolean pretty)
               throws java.io.IOException
Description copied from interface: MetaDataSerializer
Serialize the current set of objects to the given file, optionally appending and pretty-printing.

Specified by:
serialize in interface MetaDataSerializer
java.io.IOException

serialize

public void serialize(java.io.Writer out,
                      boolean pretty)
               throws java.io.IOException
Description copied from interface: MetaDataSerializer
Serialize the current set of objects to the given stream, optionally pretty-printing the result.

Specified by:
serialize in interface MetaDataSerializer
java.io.IOException

serialize

public void serialize(javax.xml.transform.Result result)
               throws org.xml.sax.SAXException
Serialize the current set of objects to the given result.

org.xml.sax.SAXException

serialize

public void serialize(org.xml.sax.ContentHandler handler)
               throws org.xml.sax.SAXException
Serilize the current set of objects to a series of SAX events on the given handler.

org.xml.sax.SAXException

startElement

protected void startElement(java.lang.String name)
                     throws org.xml.sax.SAXException
Start an element with the current attribute settings. Clears the attributes as well.

org.xml.sax.SAXException

endElement

protected void endElement(java.lang.String name)
                   throws org.xml.sax.SAXException
End the current element.

org.xml.sax.SAXException

addAttribute

protected void addAttribute(java.lang.String name,
                            java.lang.String value)
Add an attribute to the current group.


reset

protected void reset()
Reset serialization state for the next document.


serialize

protected abstract void serialize(java.util.Collection objs)
                           throws org.xml.sax.SAXException
Serialize the given set of objects to the given handler.

org.xml.sax.SAXException

getObjects

protected abstract java.util.Collection getObjects()
Return the current set of objects set for serialization.


SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.