public class XMLPersistenceMetaDataSerializer extends CFMetaDataSerializer implements AbstractCFMetaDataFactory.Serializer
Modifier and Type | Class and Description |
---|---|
protected class |
XMLPersistenceMetaDataSerializer.SerializationComparator
Compares clases, sequences, and queries to order them for serialization.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
TYPE_CLASS_QUERIES |
protected static int |
TYPE_CLASS_SEQS |
protected static int |
TYPE_META |
protected static int |
TYPE_QUERY |
protected static int |
TYPE_SEQ |
APPEND, COMPACT, PRETTY, VERBOSE
Constructor and Description |
---|
XMLPersistenceMetaDataSerializer(OpenJPAConfiguration conf)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(MetaDataRepository repos)
Add all components in the given repository to the set to be serialized.
|
protected void |
addClassMappingAttributes(ClassMetaData mapping)
Add mapping attributes for the given class.
|
protected void |
addFieldMappingAttributes(FieldMetaData fmd,
FieldMetaData orig)
Add mapping attributes for the given field.
|
void |
addMetaData(ClassMetaData meta)
Add a class meta data to the set to be serialized.
|
void |
addQueryMetaData(QueryMetaData meta)
Add a query meta data to the set to be serialized.
|
void |
addSequenceMetaData(SequenceMetaData meta)
Add a sequence meta data to the set to be serialized.
|
protected void |
addStrategyMappingAttributes(FieldMetaData fmd)
Set mapping attributes for strategy.
|
protected void |
addSystemMappingElements(Collection toSerialize)
Add system-level mapping elements to be serialized.
|
void |
clear()
Clear the set of metadatas to be serialized.
|
Map<String,ClassMetaData> |
getClassMetaData()
Returns the stored ClassMetaData
|
OpenJPAConfiguration |
getConfiguration()
Configuration.
|
int |
getMode()
The serialization mode according to the expected document type.
|
protected Collection |
getObjects()
Return the current set of objects for serialization.
|
protected String |
getPackage(Object obj)
Return the package name of the given object, or null if not in a
package.
|
boolean |
getSerializeAnnotations()
Whether to serialize content originally specified in annotations.
|
protected File |
getSourceFile(Object obj)
Override to not overwrite annotations.
|
protected PersistenceStrategy |
getStrategy(FieldMetaData fmd)
Return the serialized strategy name.
|
protected boolean |
isMappingMode()
Convenience method for interpreting
getMode() . |
protected boolean |
isMappingMode(ClassMetaData meta)
Convenience method for interpreting
getMode() . |
protected boolean |
isMappingMode(ValueMetaData vmd)
Convenience method for interpreting
getMode() . |
protected boolean |
isMetaDataMode()
Convenience method for interpreting
getMode() . |
protected boolean |
isQueryMode()
Convenience method for interpreting
getMode() . |
protected XMLPersistenceMetaDataSerializer.SerializationComparator |
newSerializationComparator()
Create a new comparator for ordering objects that are to be serialized.
|
boolean |
removeAll(MetaDataRepository repos)
Remove all the components in the given repository from the set to be
serialized.
|
boolean |
removeMetaData(ClassMetaData meta)
Remove a metadata from the set to be serialized.
|
boolean |
removeQueryMetaData(QueryMetaData meta)
Remove a query metadata from the set to be serialized.
|
boolean |
removeSequenceMetaData(SequenceMetaData meta)
Remove a sequence metadata from the set to be serialized.
|
protected void |
serialize(Collection objects)
Serialize the given set of objects.
|
protected boolean |
serializeAttributeOverride(FieldMetaData fmd,
FieldMetaData orig)
Always returns false by default.
|
protected void |
serializeAttributeOverrideMappingContent(FieldMetaData fmd,
FieldMetaData orig)
Serialize attribute override mapping content.
|
protected void |
serializeClass(ClassMetaData meta,
boolean access)
Serialize class metadata.
|
protected void |
serializeClassMappingContent(ClassMetaData mapping)
Serialize class mapping content.
|
protected void |
serializeFieldMappingContent(FieldMetaData fmd,
PersistenceStrategy strategy)
Serialize field mapping content; this will be called before
#serializeValueMappingContent . |
protected void |
serializeInheritanceContent(ClassMetaData mapping)
Serialize inheritance content.
|
protected void |
serializeOrderColumn(FieldMetaData fmd)
Order column is not processed as meta data, instead it
can be processed as mapping data if in mapping mode.
|
protected void |
serializeQueryMappings(ClassMetaData meta)
Serialize query mappings.
|
protected void |
serializeSequence(SequenceMetaData meta)
Serialize sequence metadata.
|
protected void |
serializeSystemMappingElement(Object obj)
Serialize unknown mapping element at system level.
|
void |
setMode(int mode)
The serialization mode according to the expected document type.
|
void |
setMode(int mode,
boolean on)
The serialization mode according to the expected document type.
|
void |
setSerializeAnnotations(boolean annos)
Whether to serialize content originally specified in annotations.
|
protected int |
type(Object o)
Return the type constant for the given object based on its runtime
class.
|
getClassName, getPackage, groupByPackage, setPackage
addAttribute, addComments, addComments, addText, currentBackupFile, endElement, getAttributes, getFileMap, getLog, isVerbose, prepareWrite, reset, serialize, serialize, serialize, serialize, serialize, serialize, setLog, startElement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
serialize, serialize, serialize, serialize
protected static final int TYPE_SEQ
protected static final int TYPE_QUERY
protected static final int TYPE_META
protected static final int TYPE_CLASS_SEQS
protected static final int TYPE_CLASS_QUERIES
public XMLPersistenceMetaDataSerializer(OpenJPAConfiguration conf)
public OpenJPAConfiguration getConfiguration()
public boolean getSerializeAnnotations()
public void setSerializeAnnotations(boolean annos)
public int getMode()
public void setMode(int mode)
setMode
in interface AbstractCFMetaDataFactory.Serializer
public void setMode(int mode, boolean on)
protected File getSourceFile(Object obj)
getSourceFile
in class XMLMetaDataSerializer
protected boolean isMetaDataMode()
getMode()
.protected boolean isQueryMode()
getMode()
.protected boolean isMappingMode()
getMode()
.protected boolean isMappingMode(ClassMetaData meta)
getMode()
. Takes into
account whether mapping information is loaded for the given instance.protected boolean isMappingMode(ValueMetaData vmd)
getMode()
. Takes into
account whether mapping information is loaded for the given instance.public void addMetaData(ClassMetaData meta)
addMetaData
in interface AbstractCFMetaDataFactory.Serializer
public void addSequenceMetaData(SequenceMetaData meta)
addSequenceMetaData
in interface AbstractCFMetaDataFactory.Serializer
public void addQueryMetaData(QueryMetaData meta)
addQueryMetaData
in interface AbstractCFMetaDataFactory.Serializer
public void addAll(MetaDataRepository repos)
addAll
in interface AbstractCFMetaDataFactory.Serializer
public boolean removeMetaData(ClassMetaData meta)
removeMetaData
in interface AbstractCFMetaDataFactory.Serializer
public boolean removeSequenceMetaData(SequenceMetaData meta)
public boolean removeQueryMetaData(QueryMetaData meta)
public boolean removeAll(MetaDataRepository repos)
public void clear()
protected Collection getObjects()
XMLMetaDataSerializer
getObjects
in class XMLMetaDataSerializer
protected void addSystemMappingElements(Collection toSerialize)
protected XMLPersistenceMetaDataSerializer.SerializationComparator newSerializationComparator()
protected void serialize(Collection objects) throws SAXException
XMLMetaDataSerializer
serialize
in class XMLMetaDataSerializer
SAXException
protected String getPackage(Object obj)
CFMetaDataSerializer
CFMetaDataSerializer.groupByPackage(java.util.Collection<java.lang.Object>)
. Returns null by default.getPackage
in class CFMetaDataSerializer
protected int type(Object o)
protected void serializeSystemMappingElement(Object obj) throws SAXException
SAXException
protected void serializeSequence(SequenceMetaData meta) throws SAXException
SAXException
protected void serializeClass(ClassMetaData meta, boolean access) throws SAXException
SAXException
protected void addClassMappingAttributes(ClassMetaData mapping) throws SAXException
SAXException
protected void serializeClassMappingContent(ClassMetaData mapping) throws SAXException
SAXException
protected void serializeInheritanceContent(ClassMetaData mapping) throws SAXException
SAXException
protected void serializeQueryMappings(ClassMetaData meta) throws SAXException
SAXException
protected void addFieldMappingAttributes(FieldMetaData fmd, FieldMetaData orig) throws SAXException
SAXException
protected boolean serializeAttributeOverride(FieldMetaData fmd, FieldMetaData orig)
protected void serializeAttributeOverrideMappingContent(FieldMetaData fmd, FieldMetaData orig) throws SAXException
SAXException
protected PersistenceStrategy getStrategy(FieldMetaData fmd)
protected void serializeFieldMappingContent(FieldMetaData fmd, PersistenceStrategy strategy) throws SAXException
#serializeValueMappingContent
. Does nothing by default.SAXException
protected void addStrategyMappingAttributes(FieldMetaData fmd) throws SAXException
SAXException
protected void serializeOrderColumn(FieldMetaData fmd) throws SAXException
SAXException
public Map<String,ClassMetaData> getClassMetaData()
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.