org.apache.openjpa.persistence
Class PersistenceProductDerivation.ConfigurationParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.openjpa.lib.meta.XMLMetaDataParser
          extended by org.apache.openjpa.persistence.PersistenceProductDerivation.ConfigurationParser
All Implemented Interfaces:
MetaDataParser, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, 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.


Constructor Summary
PersistenceProductDerivation.ConfigurationParser(Map map)
           
 
Method Summary
protected  void endElement(String name)
          Override this method marking the end of some element.
protected  Object getSchemaSource()
          Implement to return the XML schema source for the document.
 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 reset()
          Override this method to clear any state and ready the parser for a new document.
protected  boolean startElement(String name, 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, 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, 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
 

Constructor Detail

PersistenceProductDerivation.ConfigurationParser

public PersistenceProductDerivation.ConfigurationParser(Map map)
Method Detail

parse

public void parse(URL url)
           throws IOException
Description copied from interface: MetaDataParser
Parse the given resource.

Specified by:
parse in interface MetaDataParser
Overrides:
parse in class XMLMetaDataParser
Throws:
IOException

parse

public void parse(File file)
           throws 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 interface MetaDataParser
Overrides:
parse in class XMLMetaDataParser
Throws:
IOException

getSchemaSource

protected Object getSchemaSource()
Description copied from class: XMLMetaDataParser
Implement to return the XML schema source for the document. Returns null by default. May return:

Overrides:
getSchemaSource in class XMLMetaDataParser

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 call super.reset() to clear superclass state.

Overrides:
reset in class XMLMetaDataParser

startElement

protected boolean startElement(String name,
                               Attributes attrs)
                        throws 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 class XMLMetaDataParser
Throws:
SAXException

endElement

protected void endElement(String name)
                   throws SAXException
Description copied from class: XMLMetaDataParser
Override this method marking the end of some element.

Specified by:
endElement in class XMLMetaDataParser
Throws:
SAXException


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