org.apache.openjpa.jdbc.schema
Class XMLSchemaSerializer

java.lang.Object
  extended by org.apache.openjpa.lib.meta.XMLMetaDataSerializer
      extended by org.apache.openjpa.jdbc.schema.XMLSchemaSerializer
All Implemented Interfaces:
SchemaSerializer, MetaDataSerializer

public class XMLSchemaSerializer
extends XMLMetaDataSerializer
implements SchemaSerializer

Serializes Schemas to XML matching the document type definition defined by the XMLSchemaParser. The serializer actually works at the fine-grained table level to allow you to split schemas among multiple files. Serializers are not thread safe.

Author:
Abe White

Field Summary
 
Fields inherited from interface org.apache.openjpa.lib.meta.MetaDataSerializer
APPEND, COMPACT, PRETTY, VERBOSE
 
Constructor Summary
XMLSchemaSerializer(JDBCConfiguration conf)
          Constructor.
 
Method Summary
 void addAll(Schema schema)
          Add the given schema's objects to the set of objects that will be serialized.
 void addAll(SchemaGroup group)
          Add all the objects in the given group to the set of objects that will be serialized.
 void addSequence(Sequence seq)
           
 void addTable(Table table)
          Add the given table to the set of tables that will be serialized.
 void clear()
          Clear the set of objects to be serialized.
protected  Collection getObjects()
          Return the current set of objects for serialization.
 Sequence[] getSequences()
           
 Table[] getTables()
          Return the set of tables that will be serialized.
 boolean removeAll(Schema schema)
          Remove the given schema's objects from the set to be serialized.
 boolean removeAll(SchemaGroup group)
          Remove all schemas in the given group from the set to be serialized.
 boolean removeSequence(Sequence seq)
           
 boolean removeTable(Table table)
          Remove the given table from the set to be serialized.
protected  void serialize(Collection objs)
          Serialize the given set of objects.
 
Methods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataSerializer
addAttribute, addComments, addComments, addText, currentBackupFile, endElement, getAttributes, getFileMap, getLog, getSourceFile, isVerbose, prepareWrite, reset, serialize, serialize, serialize, serialize, serialize, serialize, setLog, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.lib.meta.MetaDataSerializer
serialize, serialize, serialize, serialize
 

Constructor Detail

XMLSchemaSerializer

public XMLSchemaSerializer(JDBCConfiguration conf)
Constructor. Supply configuration.

Method Detail

getTables

public Table[] getTables()
Description copied from interface: SchemaSerializer
Return the set of tables that will be serialized.

Specified by:
getTables in interface SchemaSerializer

addTable

public void addTable(Table table)
Description copied from interface: SchemaSerializer
Add the given table to the set of tables that will be serialized.

Specified by:
addTable in interface SchemaSerializer

removeTable

public boolean removeTable(Table table)
Description copied from interface: SchemaSerializer
Remove the given table from the set to be serialized.

Specified by:
removeTable in interface SchemaSerializer
Returns:
true if table was removed, false if not in set

getSequences

public Sequence[] getSequences()

addSequence

public void addSequence(Sequence seq)

removeSequence

public boolean removeSequence(Sequence seq)

addAll

public void addAll(Schema schema)
Description copied from interface: SchemaSerializer
Add the given schema's objects to the set of objects that will be serialized.

Specified by:
addAll in interface SchemaSerializer

addAll

public void addAll(SchemaGroup group)
Description copied from interface: SchemaSerializer
Add all the objects in the given group to the set of objects that will be serialized.

Specified by:
addAll in interface SchemaSerializer

removeAll

public boolean removeAll(Schema schema)
Description copied from interface: SchemaSerializer
Remove the given schema's objects from the set to be serialized.

Specified by:
removeAll in interface SchemaSerializer
Returns:
true if any objects in schema removed, false if none in set

removeAll

public boolean removeAll(SchemaGroup group)
Description copied from interface: SchemaSerializer
Remove all schemas in the given group from the set to be serialized.

Specified by:
removeAll in interface SchemaSerializer
Returns:
true if any objects in the group were removed, false if none in set

clear

public void clear()
Description copied from interface: SchemaSerializer
Clear the set of objects to be serialized.

Specified by:
clear in interface SchemaSerializer

getObjects

protected Collection getObjects()
Description copied from class: XMLMetaDataSerializer
Return the current set of objects for serialization.

Specified by:
getObjects in class XMLMetaDataSerializer

serialize

protected void serialize(Collection objs)
                  throws SAXException
Description copied from class: XMLMetaDataSerializer
Serialize the given set of objects.

Specified by:
serialize in class XMLMetaDataSerializer
Throws:
SAXException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.