Package org.apache.openjpa.jdbc.schema
Class XMLSchemaSerializer
- java.lang.Object
-
- org.apache.openjpa.lib.meta.XMLMetaDataSerializer
-
- org.apache.openjpa.jdbc.schema.XMLSchemaSerializer
-
- All Implemented Interfaces:
SchemaSerializer
,MetaDataSerializer
public class XMLSchemaSerializer extends XMLMetaDataSerializer implements SchemaSerializer
SerializesSchema
s to XML matching the document type definition defined by theXMLSchemaParser
. 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
Constructors Constructor Description XMLSchemaSerializer(JDBCConfiguration conf)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 java.util.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(java.util.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 interfaceSchemaSerializer
-
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 interfaceSchemaSerializer
-
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 interfaceSchemaSerializer
- 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 interfaceSchemaSerializer
-
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 interfaceSchemaSerializer
-
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 interfaceSchemaSerializer
- 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 interfaceSchemaSerializer
- 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 interfaceSchemaSerializer
-
getObjects
protected java.util.Collection getObjects()
Description copied from class:XMLMetaDataSerializer
Return the current set of objects for serialization.- Specified by:
getObjects
in classXMLMetaDataSerializer
-
serialize
protected void serialize(java.util.Collection objs) throws org.xml.sax.SAXException
Description copied from class:XMLMetaDataSerializer
Serialize the given set of objects.- Specified by:
serialize
in classXMLMetaDataSerializer
- Throws:
org.xml.sax.SAXException
-
-