Package org.apache.openjpa.persistence
Class PersistenceProductDerivation.ConfigurationParser
- java.lang.Object
 - 
- org.xml.sax.helpers.DefaultHandler
 - 
- org.apache.openjpa.lib.meta.XMLMetaDataParser
 - 
- org.apache.openjpa.persistence.PersistenceProductDerivation.ConfigurationParser
 
 
 
 
- 
- All Implemented Interfaces:
 MetaDataParser,org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler,org.xml.sax.ext.LexicalHandler
- Enclosing class:
 - PersistenceProductDerivation
 
public static class PersistenceProductDerivation.ConfigurationParser extends XMLMetaDataParser
SAX handler capable of parsing an JPA persistence.xml file. Package-protected for testing. 
- 
- 
Field Summary
- 
Fields inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
_extendedNamespace, _openjpaNamespace 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ConfigurationParser(java.util.Map map) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidendElement(java.lang.String name)Override this method marking the end of some element.protected java.lang.ObjectgetSchemaSource()Implement to return the XML schema source for the document.voidparse(java.io.File file)Parse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.voidparse(java.net.URL url)Parse the given resource.protected voidreset()Override this method to clear any state and ready the parser for a new document.protected booleanstartElement(java.lang.String name, org.xml.sax.Attributes attrs)Override this method marking the start of some element.- 
Methods inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
addComments, addResult, characters, clear, clearDeferredMetaData, 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, startEntity 
 - 
 
 - 
 
- 
- 
Method Detail
- 
parse
public void parse(java.net.URL url) throws java.io.IOExceptionDescription copied from interface:MetaDataParserParse the given resource.- Specified by:
 parsein interfaceMetaDataParser- Overrides:
 parsein classXMLMetaDataParser- Throws:
 java.io.IOException
 
- 
parse
public void parse(java.io.File file) throws java.io.IOExceptionDescription copied from interface:MetaDataParserParse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.- Specified by:
 parsein interfaceMetaDataParser- Overrides:
 parsein classXMLMetaDataParser- Throws:
 java.io.IOException
 
- 
getSchemaSource
protected java.lang.Object getSchemaSource()
Description copied from class:XMLMetaDataParserImplement to return the XML schema source for the document. Returns null by default. May return:Stringpointing to schema URI.InputStreamcontaining schema contents.InputSourcecontaining schema contents.Filecontaining schema contents.- Array of any of the above elements.
 
- Overrides:
 getSchemaSourcein classXMLMetaDataParser
 
- 
reset
protected void reset()
Description copied from class:XMLMetaDataParserOverride this method to clear any state and ready the parser for a new document. Subclasses should callsuper.reset()to clear superclass state.- Overrides:
 resetin classXMLMetaDataParser
 
- 
startElement
protected boolean startElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXExceptionDescription copied from class:XMLMetaDataParserOverride this method marking the start of some element. If this method returns false, the content of the element and the end element event will be ignored.- Specified by:
 startElementin classXMLMetaDataParser- Throws:
 org.xml.sax.SAXException
 
- 
endElement
protected void endElement(java.lang.String name) throws org.xml.sax.SAXExceptionDescription copied from class:XMLMetaDataParserOverride this method marking the end of some element.- Specified by:
 endElementin classXMLMetaDataParser- Throws:
 org.xml.sax.SAXException
 
 - 
 
 -