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 void
endElement(java.lang.String name)
Override this method marking the end of some element.protected java.lang.Object
getSchemaSource()
Implement to return the XML schema source for the document.void
parse(java.io.File file)
Parse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.void
parse(java.net.URL url)
Parse the given resource.protected void
reset()
Override this method to clear any state and ready the parser for a new document.protected boolean
startElement(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.IOException
Description copied from interface:MetaDataParser
Parse the given resource.- Specified by:
parse
in interfaceMetaDataParser
- Overrides:
parse
in classXMLMetaDataParser
- Throws:
java.io.IOException
-
parse
public void parse(java.io.File file) throws java.io.IOException
Description copied from interface:MetaDataParser
Parse the given file, which may be a directory, in which case it will be scanned recursively for metadata files.- Specified by:
parse
in interfaceMetaDataParser
- Overrides:
parse
in classXMLMetaDataParser
- Throws:
java.io.IOException
-
getSchemaSource
protected java.lang.Object getSchemaSource()
Description copied from class:XMLMetaDataParser
Implement to return the XML schema source for the document. Returns null by default. May return:String
pointing to schema URI.InputStream
containing schema contents.InputSource
containing schema contents.File
containing schema contents.- Array of any of the above elements.
- Overrides:
getSchemaSource
in classXMLMetaDataParser
-
reset
protected void reset()
Description copied from class:XMLMetaDataParser
Override this method to clear any state and ready the parser for a new document. Subclasses should callsuper.reset()
to clear superclass state.- Overrides:
reset
in classXMLMetaDataParser
-
startElement
protected boolean startElement(java.lang.String name, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
Description copied from class:XMLMetaDataParser
Override 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:
startElement
in classXMLMetaDataParser
- Throws:
org.xml.sax.SAXException
-
endElement
protected void endElement(java.lang.String name) throws org.xml.sax.SAXException
Description copied from class:XMLMetaDataParser
Override this method marking the end of some element.- Specified by:
endElement
in classXMLMetaDataParser
- Throws:
org.xml.sax.SAXException
-
-