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
SerializesSchemas 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 voidaddAll(Schema schema)Add the given schema's objects to the set of objects that will be serialized.voidaddAll(SchemaGroup group)Add all the objects in the given group to the set of objects that will be serialized.voidaddSequence(Sequence seq)voidaddTable(Table table)Add the given table to the set of tables that will be serialized.voidclear()Clear the set of objects to be serialized.protected CollectiongetObjects()Return the current set of objects for serialization.Sequence[]getSequences()Table[]getTables()Return the set of tables that will be serialized.booleanremoveAll(Schema schema)Remove the given schema's objects from the set to be serialized.booleanremoveAll(SchemaGroup group)Remove all schemas in the given group from the set to be serialized.booleanremoveSequence(Sequence seq)booleanremoveTable(Table table)Remove the given table from the set to be serialized.protected voidserialize(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:SchemaSerializerReturn the set of tables that will be serialized.- Specified by:
getTablesin interfaceSchemaSerializer
-
addTable
public void addTable(Table table)
Description copied from interface:SchemaSerializerAdd the given table to the set of tables that will be serialized.- Specified by:
addTablein interfaceSchemaSerializer
-
removeTable
public boolean removeTable(Table table)
Description copied from interface:SchemaSerializerRemove the given table from the set to be serialized.- Specified by:
removeTablein 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:SchemaSerializerAdd the given schema's objects to the set of objects that will be serialized.- Specified by:
addAllin interfaceSchemaSerializer
-
addAll
public void addAll(SchemaGroup group)
Description copied from interface:SchemaSerializerAdd all the objects in the given group to the set of objects that will be serialized.- Specified by:
addAllin interfaceSchemaSerializer
-
removeAll
public boolean removeAll(Schema schema)
Description copied from interface:SchemaSerializerRemove the given schema's objects from the set to be serialized.- Specified by:
removeAllin interfaceSchemaSerializer- Returns:
- true if any objects in schema removed, false if none in set
-
removeAll
public boolean removeAll(SchemaGroup group)
Description copied from interface:SchemaSerializerRemove all schemas in the given group from the set to be serialized.- Specified by:
removeAllin interfaceSchemaSerializer- Returns:
- true if any objects in the group were removed, false if none in set
-
clear
public void clear()
Description copied from interface:SchemaSerializerClear the set of objects to be serialized.- Specified by:
clearin interfaceSchemaSerializer
-
getObjects
protected Collection getObjects()
Description copied from class:XMLMetaDataSerializerReturn the current set of objects for serialization.- Specified by:
getObjectsin classXMLMetaDataSerializer
-
serialize
protected void serialize(Collection objs) throws SAXException
Description copied from class:XMLMetaDataSerializerSerialize the given set of objects.- Specified by:
serializein classXMLMetaDataSerializer- Throws:
SAXException
-
-