Package org.apache.openjpa.lib.meta
Class XMLVersionParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.openjpa.lib.meta.XMLMetaDataParser
-
- org.apache.openjpa.lib.meta.XMLVersionParser
-
- 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
public class XMLVersionParser extends XMLMetaDataParser
Custom non-validating SAX parser which can be used to get the version and schema location attributes from the root node.- Author:
- Jeremy Bauer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVERSION_1_0static java.lang.StringVERSION_2_0static java.lang.StringVERSION_2_1static java.lang.StringVERSION_2_2-
Fields inherited from class org.apache.openjpa.lib.meta.XMLMetaDataParser
_extendedNamespace, _openjpaNamespace
-
-
Constructor Summary
Constructors Constructor Description XMLVersionParser(java.lang.String rootElement)
-
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.java.lang.StringgetSchemaLocation()Get the string value of the schema location attribute on the root elementjava.lang.StringgetVersion()Get the string value of the version attribute on the root elementprotected 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, getSchemaSource, getSourceFile, getSourceIsSystemId, getSourceName, getSuffix, ignoreContent, isCaching, isParsing, isValidating, parse, parse, parse, parse, parse, parse, parsed, parseNewResource, reset, setCaching, setClassLoader, setDocumentLocator, setLexicalHandler, setLocation, setLog, setOverrideContextClassloader, setParseComments, setParseText, setParsing, setSourceIsSystemId, setSuffix, setValidating, startCDATA, startDTD, startElement, startEntity
-
-
-
-
Field Detail
-
VERSION_1_0
public static final java.lang.String VERSION_1_0
- See Also:
- Constant Field Values
-
VERSION_2_0
public static final java.lang.String VERSION_2_0
- See Also:
- Constant Field Values
-
VERSION_2_1
public static final java.lang.String VERSION_2_1
- See Also:
- Constant Field Values
-
VERSION_2_2
public static final java.lang.String VERSION_2_2
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
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
-
getVersion
public java.lang.String getVersion()
Get the string value of the version attribute on the root element- Returns:
- doc version
-
getSchemaLocation
public java.lang.String getSchemaLocation()
Get the string value of the schema location attribute on the root element- Returns:
- doc schema location
-
-