org.apache.openjpa.persistence.jdbc
Class XMLPersistenceMappingParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.openjpa.lib.meta.XMLMetaDataParser
          extended by org.apache.openjpa.lib.meta.CFMetaDataParser
              extended by org.apache.openjpa.persistence.XMLPersistenceMetaDataParser
                  extended by org.apache.openjpa.persistence.jdbc.XMLPersistenceMappingParser
All Implemented Interfaces:
MetaDataParser, AbstractCFMetaDataFactory.Parser, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler

public class XMLPersistenceMappingParser
extends XMLPersistenceMetaDataParser

Custom SAX parser used by the system to parse persistence mapping files.

Author:
Steve Kim

Field Summary
 
Fields inherited from class org.apache.openjpa.persistence.XMLPersistenceMetaDataParser
ELEM_ACCESS, ELEM_ATTRS, ELEM_CASCADE, ELEM_CASCADE_ALL, ELEM_CASCADE_MER, ELEM_CASCADE_PER, ELEM_CASCADE_REF, ELEM_CASCADE_REM, ELEM_LISTENER, ELEM_PKG, ELEM_PU_DEF, ELEM_PU_META, ELEM_XML_MAP_META_COMPLETE
 
Constructor Summary
XMLPersistenceMappingParser(JDBCConfiguration conf)
          Constructor; supply configuration.
 
Method Summary
protected  void endClassMapping(ClassMetaData meta)
          Implement to finalize class mapping.
protected  void endClassMappingElement(String name)
          Implement to parse a mapping element within a class.
protected  void endFieldMapping(FieldMetaData field)
          Extend to set the columns.
protected  void endSystemMappingElement(String name)
          Implement to parse a mapping element outside of any class.
protected  void reset()
          Override this method to clear any state and ready the parser for a new document.
protected  void startClassMapping(ClassMetaData meta, 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  void startFieldMapping(FieldMetaData field, Attributes attrs)
          Extend to clear annotation mapping info.
protected  boolean startLob(Attributes attrs)
          Parse lob.
protected  Object startSystemMappingElement(String name, Attributes attrs)
          Implement to parse a mapping element outside of any class.
 
Methods inherited from class org.apache.openjpa.persistence.XMLPersistenceMetaDataParser
classForName, currentElement, currentParent, currentStrategy, endClass, endClassElement, endEmbeddedId, endGeneratedValue, endId, endIdClass, endLob, endNamedNativeQuery, endNamedQuery, endQueryHint, endQueryString, endSequenceGenerator, endSystemElement, endVersion, getAnnotationParser, getClassAttributeName, getClassElementDepth, getConfiguration, getEnvClassLoader, getMappingOverride, getMode, getPackageAttributeName, getRepository, getSchemaSource, isClassElementName, isMappingMode, isMappingOverrideMode, isMetaDataMode, isQueryMode, isRuntime, parseBasic, parseEmbedded, parseManyToMany, parseManyToOne, parseOneToMany, parseOneToOne, popElement, pushElement, setAnnotationParser, setCascades, setEnvClassLoader, setMappingOverride, setMode, setMode, setRepository, startCascade, startClass, startClassElement, startEmbeddedId, startGeneratedValue, startId, startIdClass, startNamedNativeQuery, startNamedQuery, startQueryHint, startQueryString, startSequenceGenerator, startSystemElement, startVersion
 
Methods inherited from class org.apache.openjpa.lib.meta.CFMetaDataParser
classForName, classForName, currentClassName, currentPackage, endElement, endPackage, endPackageElement, getPackageElementDepth, isPackageElementName, startElement, startPackage, startPackageElement
 
Methods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
addComments, addResult, characters, clear, comment, currentClassLoader, currentComments, currentDepth, currentLocation, currentText, endCDATA, endDTD, endElement, endEntity, error, fatalError, finish, getClassLoader, getDocType, getException, getException, getException, getLexicalHandler, getLocation, getLog, getParseComments, getParseText, getResults, getSourceFile, getSourceIsSystemId, getSourceName, getSuffix, ignoreContent, isCaching, isValidating, parse, parse, parse, parse, parse, parse, parsed, parseNewResource, setCaching, setClassLoader, setDocumentLocator, setLexicalHandler, setLocation, setLog, setParseComments, setParseText, setSourceIsSystemId, setSuffix, setValidating, startCDATA, startDTD, startElement, startEntity
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
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.MetaDataParser
clear, getResults, parse, parse, parse, parse, parse, parse, setClassLoader
 

Constructor Detail

XMLPersistenceMappingParser

public XMLPersistenceMappingParser(JDBCConfiguration conf)
Constructor; supply configuration.

Method Detail

reset

protected void reset()
Description copied from class: CFMetaDataParser
Override this method to clear any state and ready the parser for a new document. Subclasses should call super.reset() to clear superclass state.

Overrides:
reset in class XMLPersistenceMetaDataParser

startSystemMappingElement

protected Object startSystemMappingElement(String name,
                                           Attributes attrs)
                                    throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to parse a mapping element outside of any class.

Overrides:
startSystemMappingElement in class XMLPersistenceMetaDataParser
Returns:
the tag for the given element, or null to skip the element
Throws:
SAXException

endSystemMappingElement

protected void endSystemMappingElement(String name)
                                throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to parse a mapping element outside of any class.

Overrides:
endSystemMappingElement in class XMLPersistenceMetaDataParser
Throws:
SAXException

startClassMappingElement

protected Object startClassMappingElement(String name,
                                          Attributes attrs)
                                   throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to parse a mapping element within a class.

Overrides:
startClassMappingElement in class XMLPersistenceMetaDataParser
Returns:
the tag for the given element, or null to skip element
Throws:
SAXException

endClassMappingElement

protected void endClassMappingElement(String name)
                               throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to parse a mapping element within a class.

Overrides:
endClassMappingElement in class XMLPersistenceMetaDataParser
Throws:
SAXException

startClassMapping

protected void startClassMapping(ClassMetaData meta,
                                 boolean mappedSuper,
                                 Attributes attrs)
                          throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to add mapping attributes to class.

Overrides:
startClassMapping in class XMLPersistenceMetaDataParser
Throws:
SAXException

endClassMapping

protected void endClassMapping(ClassMetaData meta)
                        throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Implement to finalize class mapping.

Overrides:
endClassMapping in class XMLPersistenceMetaDataParser
Throws:
SAXException

startLob

protected boolean startLob(Attributes attrs)
                    throws SAXException
Description copied from class: XMLPersistenceMetaDataParser
Parse lob.

Overrides:
startLob in class XMLPersistenceMetaDataParser
Throws:
SAXException

startFieldMapping

protected void startFieldMapping(FieldMetaData field,
                                 Attributes attrs)
                          throws SAXException
Extend to clear annotation mapping info.

Overrides:
startFieldMapping in class XMLPersistenceMetaDataParser
Throws:
SAXException

endFieldMapping

protected void endFieldMapping(FieldMetaData field)
                        throws SAXException
Extend to set the columns.

Overrides:
endFieldMapping in class XMLPersistenceMetaDataParser
Throws:
SAXException


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.