public class XMLPersistenceMetaDataParser extends CFMetaDataParser implements AbstractCFMetaDataFactory.Parser
| Modifier and Type | Class and Description |
|---|---|
protected static class |
XMLPersistenceMetaDataParser.localDBIdentifiers |
| Modifier and Type | Field and Description |
|---|---|
protected Class<?> |
_cls |
protected static String |
ELEM_ACCESS |
protected static String |
ELEM_ATTRS |
protected static String |
ELEM_CASCADE |
protected static String |
ELEM_CASCADE_ALL |
protected static String |
ELEM_CASCADE_DET |
protected static String |
ELEM_CASCADE_MER |
protected static String |
ELEM_CASCADE_PER |
protected static String |
ELEM_CASCADE_REF |
protected static String |
ELEM_CASCADE_REM |
protected static String |
ELEM_DELIM_IDS |
protected static String |
ELEM_LISTENER |
protected static String |
ELEM_PKG |
protected static String |
ELEM_PU_DEF |
protected static String |
ELEM_PU_META |
protected static String |
ELEM_XML_MAP_META_COMPLETE |
_extendedNamespace, _openjpaNamespace| Constructor and Description |
|---|
XMLPersistenceMetaDataParser(OpenJPAConfiguration conf)
Constructor; supply configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDeferredEmbeddableMetaData()
Process all deferred embeddables using an unknown access type.
|
protected void |
addDeferredEmbeddableMetaData(Class<?> embedType,
int access)
Process all deferred embeddables and embeddable mapping overrides
for a given class.
|
void |
addToParseList(ArrayList<Class<?>> parseList) |
void |
addToParseList(Class<?> parentCls) |
protected void |
applyDeferredEmbeddableOverrides(Class<?> cls) |
protected Class<?> |
classForName(String name)
Instantiate the given class, taking into account the default package.
|
protected void |
clearDeferredMetaData() |
protected Object |
currentElement()
Return the current element being parsed.
|
protected Object |
currentParent()
Return the tag of the current parent element.
|
protected PersistenceStrategy |
currentStrategy()
Return the current
PersistenceStrategy if any. |
protected void |
deferEmbeddable(Class<?> embedType,
MetaDataContext fmd) |
protected void |
endClass(String elem)
End a class.
|
protected void |
endClassElement(String name)
Override this method marking the end of an element within a declared
class.
|
protected void |
endClassMapping(ClassMetaData mapping)
Implement to finalize class mapping.
|
protected void |
endClassMappingElement(String name)
Implement to parse a mapping element within a class.
|
protected void |
endEmbeddedId() |
protected void |
endExtendedClass(String elem) |
protected void |
endFieldMapping(FieldMetaData field)
Implement to finalize field mapping.
|
protected void |
endGeneratedValue() |
protected void |
endId() |
protected void |
endIdClass() |
protected void |
endLob() |
protected void |
endNamedNativeQuery() |
protected void |
endNamedQuery() |
protected void |
endQueryHint() |
protected void |
endQueryString() |
protected void |
endSequenceGenerator() |
protected void |
endSystemElement(String name)
Override this method marking the end of an element outside of any
package or class.
|
protected void |
endSystemMappingElement(String name)
Implement to parse a mapping element outside of any class.
|
protected void |
endVersion() |
AnnotationPersistenceMetaDataParser |
getAnnotationParser()
The annotation parser.
|
protected String |
getClassAttributeName()
The attribute of the class element that holds the name, or null to
use the element text.
|
protected int |
getClassElementDepth()
The depth of the class element.
|
OpenJPAConfiguration |
getConfiguration()
Configuration supplied on construction.
|
ClassLoader |
getEnvClassLoader()
Return the environmental class loader to pass on to parsed
metadata instances.
|
boolean |
getMappingOverride()
Whether to allow later parses of mapping information to override
earlier information for the same class.
|
int |
getMode()
The parse mode according to the expected document type.
|
protected String |
getPackageAttributeName()
The attribute of the package element that holds the name, or null to
use the element text.
|
Class<?> |
getParseClass() |
ArrayList<Class<?>> |
getParseList() |
MetaDataRepository |
getRepository()
Returns the repository for this parser.
|
protected Object |
getSchemaSource()
Implement to return the XML schema source for the document.
|
protected boolean |
isClassElementName(String name)
The name of the class element.
|
protected boolean |
isDeferredEmbeddable(Class<?> embedType,
MetaDataContext fmd) |
protected boolean |
isDuplicateClass(ClassMetaData meta)
Determines whether the ClassMetaData has been resolved more than once.
|
protected boolean |
isDuplicateQuery(QueryMetaData meta)
Determines whether the QueryMetaData has been resolved more than once.
|
protected boolean |
isMappingMode()
Convenience method for interpreting
getMode(). |
protected boolean |
isMappingOverrideMode()
Returns true if we're in mapping mode or in metadata mode with
mapping override enabled.
|
protected boolean |
isMetaDataMode()
Convenience method for interpreting
getMode(). |
protected boolean |
isQueryMode()
Convenience method for interpreting
getMode(). |
protected boolean |
isRuntime()
Return whether we're running the parser at runtime.
|
protected String |
normalizeCatalogName(String catName) |
protected String |
normalizeSchemaName(String schName) |
protected String |
normalizeSequenceName(String seqName) |
void |
parse(File file)
Parse the given file, which may be a directory, in which case it
will be scanned recursively for metadata files.
|
void |
parse(URL url)
Parse the given resource.
|
protected void |
parseBasic(FieldMetaData fmd,
Attributes attrs)
Parse basic.
|
protected void |
parseEagerFetchModeAttr(FieldMetaData fmd,
Attributes attrs) |
protected void |
parseElementClassCriteriaAttr(FieldMetaData fmd,
Attributes attrs) |
protected void |
parseElementCollection(FieldMetaData fmd,
Attributes attrs) |
protected void |
parseEmbedded(FieldMetaData fmd,
Attributes attrs)
Parse embedded.
|
boolean |
parseListContains(Class<?> cls) |
protected void |
parseManyToMany(FieldMetaData fmd,
Attributes attrs)
Parse many-to-many.
|
protected void |
parseManyToOne(FieldMetaData fmd,
Attributes attrs)
Parse many-to-one.
|
protected void |
parseOneToMany(FieldMetaData fmd,
Attributes attrs)
Parse one-to-many.
|
protected void |
parseOneToOne(FieldMetaData fmd,
Attributes attrs)
Parse one-to-one.
|
protected void |
parseStrategy(FieldMetaData fmd,
Attributes attrs) |
protected Object |
peekElement()
Peek a parse element from the stack.
|
protected Object |
popElement()
Pop a parse element from the stack.
|
protected void |
pushElement(Object elem)
Push a parse element onto the stack.
|
protected void |
reset()
Override this method to clear any state and ready the parser for
a new document.
|
void |
setAnnotationParser(AnnotationPersistenceMetaDataParser parser)
The annotation parser.
|
protected void |
setCascades(FieldMetaData fmd)
Set the cached cascades into the field.
|
protected void |
setDeferredEmbeddableAccessType(Class<?> embedType,
int access) |
void |
setEnvClassLoader(ClassLoader loader)
Set the environmental class loader to pass on to parsed
metadata instances.
|
void |
setMappingOverride(boolean override)
Whether to allow later parses of mapping information to override
earlier information for the same class.
|
void |
setMode(int mode)
The parse mode according to the expected document type.
|
void |
setMode(int mode,
boolean on)
The parse mode according to the expected document type.
|
protected void |
setOrphanRemoval(ValueMetaData vmd,
boolean orphanRemoval) |
void |
setRepository(MetaDataRepository repos)
Set the metadata repository for this parser.
|
protected boolean |
startCascade(Object tag,
Attributes attrs)
Lazily parse cascades.
|
protected boolean |
startClass(String elem,
Attributes attrs)
Start a class.
|
protected boolean |
startClassElement(String name,
Attributes attrs)
Override this method marking the start of an element within a declared
class.
|
protected void |
startClassMapping(ClassMetaData mapping,
boolean mappedSuper,
Attributes attrs)
Implement to add mapping attributes to class.
|
protected Object |
startClassMappingElement(String name,
Attributes attrs)
Implement to parse a mapping element within a class.
|
protected boolean |
startDelimitedIdentifiers() |
protected boolean |
startEmbeddedId(Attributes attrs)
Parse embedded-id.
|
protected void |
startFieldMapping(FieldMetaData field,
Attributes attrs)
Implement to add field mapping data.
|
protected boolean |
startGeneratedValue(Attributes attrs)
Parse generated-value.
|
protected boolean |
startId(Attributes attrs)
Parse id.
|
protected boolean |
startIdClass(Attributes attrs)
Parse id-class.
|
protected boolean |
startLob(Attributes attrs)
Parse lob.
|
protected boolean |
startNamedNativeQuery(Attributes attrs)
Parse native-named-query.
|
protected boolean |
startNamedQuery(Attributes attrs)
Parse named-query.
|
protected boolean |
startOrderColumn(Attributes attrs) |
protected boolean |
startQueryHint(Attributes attrs)
Parse query-hint.
|
protected boolean |
startQueryString(Attributes attrs) |
protected boolean |
startSequenceGenerator(Attributes attrs)
Parse sequence-generator.
|
protected boolean |
startSystemElement(String name,
Attributes attrs)
Override this method marking the start of an element outside of any
package or class.
|
protected Object |
startSystemMappingElement(String name,
Attributes attrs)
Implement to parse a mapping element outside of any class.
|
protected boolean |
startVersion(Attributes attrs)
Parse version.
|
classForName, classForName, currentClassName, currentPackage, endElement, endPackage, endPackageElement, getPackageElementDepth, isPackageElementName, startElement, startExtendedClass, startPackage, startPackageElementaddComments, addResult, characters, clear, comment, currentClassLoader, currentComments, currentDepth, currentLocation, currentText, endCDATA, endDTD, endElement, endEntity, error, fatalError, finish, getClassLoader, getDocType, getException, getException, getException, getLexicalHandler, getLocation, getLog, getOverrideContextClassloader, getParseComments, getParseText, getResults, getSourceFile, getSourceIsSystemId, getSourceName, getSuffix, ignoreContent, isCaching, isParsing, isValidating, parse, parse, parse, parse, parsed, parseNewResource, setCaching, setClassLoader, setDocumentLocator, setLexicalHandler, setLocation, setLog, setOverrideContextClassloader, setParseComments, setParseText, setParsing, setSourceIsSystemId, setSuffix, setValidating, startCDATA, startDTD, startElement, startEntityendDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, getResults, parse, parse, parse, parse, setClassLoaderprotected static final String ELEM_PKG
protected static final String ELEM_ACCESS
protected static final String ELEM_ATTRS
protected static final String ELEM_LISTENER
protected static final String ELEM_CASCADE
protected static final String ELEM_CASCADE_ALL
protected static final String ELEM_CASCADE_PER
protected static final String ELEM_CASCADE_MER
protected static final String ELEM_CASCADE_REM
protected static final String ELEM_CASCADE_REF
protected static final String ELEM_CASCADE_DET
protected static final String ELEM_PU_META
protected static final String ELEM_PU_DEF
protected static final String ELEM_XML_MAP_META_COMPLETE
protected static final String ELEM_DELIM_IDS
protected Class<?> _cls
public XMLPersistenceMetaDataParser(OpenJPAConfiguration conf)
public OpenJPAConfiguration getConfiguration()
public AnnotationPersistenceMetaDataParser getAnnotationParser()
public void setAnnotationParser(AnnotationPersistenceMetaDataParser parser)
public MetaDataRepository getRepository()
getRepository in interface AbstractCFMetaDataFactory.Parserpublic void setRepository(MetaDataRepository repos)
public ClassLoader getEnvClassLoader()
public void setEnvClassLoader(ClassLoader loader)
public boolean getMappingOverride()
public void setMappingOverride(boolean override)
public int getMode()
public void setMode(int mode,
boolean on)
public void setMode(int mode)
setMode in interface AbstractCFMetaDataFactory.Parserpublic void parse(URL url) throws IOException
MetaDataParserparse in interface MetaDataParserparse in class XMLMetaDataParserIOExceptionpublic void parse(File file) throws IOException
MetaDataParserparse in interface MetaDataParserparse in class XMLMetaDataParserIOExceptionprotected boolean isMetaDataMode()
getMode().protected boolean isQueryMode()
getMode().protected boolean isMappingMode()
getMode().protected boolean isMappingOverrideMode()
protected void pushElement(Object elem)
protected Object popElement()
protected Object peekElement()
protected Object currentElement()
protected PersistenceStrategy currentStrategy()
PersistenceStrategy if any.protected Object currentParent()
protected boolean isRuntime()
protected Object getSchemaSource()
XMLMetaDataParserString pointing to schema URI.InputStream containing schema contents.InputSource containing schema contents.File containing schema contents.getSchemaSource in class XMLMetaDataParserprotected String getPackageAttributeName()
CFMetaDataParsergetPackageAttributeName in class CFMetaDataParserprotected String getClassAttributeName()
CFMetaDataParsergetClassAttributeName in class CFMetaDataParserprotected int getClassElementDepth()
CFMetaDataParsergetClassElementDepth in class CFMetaDataParserprotected boolean isClassElementName(String name)
CFMetaDataParserisClassElementName in class CFMetaDataParserprotected void reset()
CFMetaDataParsersuper.reset() to clear superclass state.reset in class CFMetaDataParserprotected boolean startSystemElement(String name, Attributes attrs) throws SAXException
CFMetaDataParserstartSystemElement in class CFMetaDataParserSAXExceptionprotected void endSystemElement(String name) throws SAXException
CFMetaDataParserendSystemElement in class CFMetaDataParserSAXExceptionprotected Object startSystemMappingElement(String name, Attributes attrs) throws SAXException
SAXExceptionprotected void endSystemMappingElement(String name) throws SAXException
SAXExceptionprotected boolean startClassElement(String name, Attributes attrs) throws SAXException
CFMetaDataParserstartClassElement in class CFMetaDataParserSAXExceptionprotected void endClassElement(String name) throws SAXException
CFMetaDataParserendClassElement in class CFMetaDataParserSAXExceptionprotected Object startClassMappingElement(String name, Attributes attrs) throws SAXException
SAXExceptionprotected void endClassMappingElement(String name) throws SAXException
SAXExceptionprotected boolean startClass(String elem, Attributes attrs) throws SAXException
CFMetaDataParserstartClass in class CFMetaDataParserSAXExceptionprotected void endClass(String elem) throws SAXException
CFMetaDataParserendClass in class CFMetaDataParserSAXExceptionprotected void startClassMapping(ClassMetaData mapping, boolean mappedSuper, Attributes attrs) throws SAXException
SAXExceptionprotected void endClassMapping(ClassMetaData mapping) throws SAXException
SAXExceptionprotected boolean startSequenceGenerator(Attributes attrs)
protected void endSequenceGenerator()
protected boolean startId(Attributes attrs) throws SAXException
SAXExceptionprotected void endId()
throws SAXException
SAXExceptionprotected boolean startEmbeddedId(Attributes attrs) throws SAXException
SAXExceptionprotected void endEmbeddedId()
throws SAXException
SAXExceptionprotected boolean startIdClass(Attributes attrs) throws SAXException
SAXExceptionprotected void endIdClass()
throws SAXException
SAXExceptionprotected boolean startLob(Attributes attrs) throws SAXException
SAXExceptionprotected void endLob()
throws SAXException
SAXExceptionprotected boolean startGeneratedValue(Attributes attrs) throws SAXException
SAXExceptionprotected void endGeneratedValue()
throws SAXException
SAXExceptionprotected boolean startCascade(Object tag, Attributes attrs) throws SAXException
SAXExceptionprotected void setCascades(FieldMetaData fmd)
protected void startFieldMapping(FieldMetaData field, Attributes attrs) throws SAXException
SAXExceptionprotected void endFieldMapping(FieldMetaData field) throws SAXException
SAXExceptionprotected boolean startVersion(Attributes attrs) throws SAXException
SAXExceptionprotected void endVersion()
throws SAXException
SAXExceptionprotected void parseBasic(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseEmbedded(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseOneToOne(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseManyToOne(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseManyToMany(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseOneToMany(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void setOrphanRemoval(ValueMetaData vmd, boolean orphanRemoval)
protected void parseElementCollection(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected boolean startNamedQuery(Attributes attrs) throws SAXException
SAXExceptionprotected void endNamedQuery()
throws SAXException
SAXExceptionprotected boolean startQueryString(Attributes attrs) throws SAXException
SAXExceptionprotected void endQueryString()
throws SAXException
SAXExceptionprotected boolean startQueryHint(Attributes attrs) throws SAXException
SAXExceptionprotected void endQueryHint()
throws SAXException
SAXExceptionprotected boolean startNamedNativeQuery(Attributes attrs) throws SAXException
SAXExceptionprotected void endNamedNativeQuery()
throws SAXException
SAXExceptionprotected boolean startOrderColumn(Attributes attrs) throws SAXException
SAXExceptionprotected Class<?> classForName(String name) throws SAXException
SAXExceptionprotected void addDeferredEmbeddableMetaData()
protected void addDeferredEmbeddableMetaData(Class<?> embedType, int access) throws SAXException
embedType - embeddable classaccess - class level access for embeddableSAXExceptionprotected void setDeferredEmbeddableAccessType(Class<?> embedType, int access)
protected void clearDeferredMetaData()
clearDeferredMetaData in class XMLMetaDataParserprotected boolean isDeferredEmbeddable(Class<?> embedType, MetaDataContext fmd)
protected void deferEmbeddable(Class<?> embedType, MetaDataContext fmd)
protected void applyDeferredEmbeddableOverrides(Class<?> cls) throws SAXException
SAXExceptionpublic void addToParseList(Class<?> parentCls)
public boolean parseListContains(Class<?> cls)
public Class<?> getParseClass()
protected boolean startDelimitedIdentifiers()
protected boolean isDuplicateClass(ClassMetaData meta)
meta - The ClassMetaData to inspect.protected boolean isDuplicateQuery(QueryMetaData meta)
meta - QueryMetaData that has already been resolved.protected void parseStrategy(FieldMetaData fmd, Attributes attrs)
protected void parseElementClassCriteriaAttr(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void parseEagerFetchModeAttr(FieldMetaData fmd, Attributes attrs) throws SAXException
SAXExceptionprotected void endExtendedClass(String elem) throws SAXException
endExtendedClass in class CFMetaDataParserSAXExceptionCopyright © 2006–2020 Apache Software Foundation. All rights reserved.