org.apache.aries.jpa.container.parsing.impl
Class JPAHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.aries.jpa.container.parsing.impl.JPAHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class JPAHandler
extends DefaultHandler

This code is responsible for parsing the persistence.xml into PersistenceUnits


Constructor Summary
JPAHandler(org.osgi.framework.Bundle b, String version)
          Create a new JPA Handler for the given peristence.xml
 
Method Summary
 void characters(char[] ch, int start, int length)
          Collect up the characters, as element's characters may be split across multiple calls.
 void endElement(String uri, String localName, String name)
           
 void error(SAXParseException spe)
           
 Collection<PersistenceUnitImpl> getPersistenceUnits()
           
 void startElement(String uri, String localName, String name, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, 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

JPAHandler

public JPAHandler(org.osgi.framework.Bundle b,
                  String version)
Create a new JPA Handler for the given peristence.xml

Parameters:
data -
version - the version of the JPA schema used in the xml
Method Detail

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Collect up the characters, as element's characters may be split across multiple calls. Isn't SAX lovely...

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String name,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String name)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

error

public void error(SAXParseException spe)
           throws SAXException
Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Throws:
SAXException

getPersistenceUnits

public Collection<PersistenceUnitImpl> getPersistenceUnits()
Returns:
The collection of persistence units that we have parsed


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.