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
Serializes
Schema
s 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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
Return the current set of objects for serialization.Sequence[]
Table[]
Return the set of tables that will be serialized.boolean
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 Details
-
XMLSchemaSerializer
Constructor. Supply configuration.
-
-
Method Details
-
getTables
Description copied from interface:SchemaSerializer
Return the set of tables that will be serialized.- Specified by:
getTables
in interfaceSchemaSerializer
-
addTable
Description copied from interface:SchemaSerializer
Add the given table to the set of tables that will be serialized.- Specified by:
addTable
in interfaceSchemaSerializer
-
removeTable
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
-
addSequence
-
removeSequence
-
addAll
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
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
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
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
Description copied from class:XMLMetaDataSerializer
Return the current set of objects for serialization.- Specified by:
getObjects
in classXMLMetaDataSerializer
-
serialize
Description copied from class:XMLMetaDataSerializer
Serialize the given set of objects.- Specified by:
serialize
in classXMLMetaDataSerializer
- Throws:
SAXException
-