org.jpox.metadata.xml
Class PersistenceFileMetaDataHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.jpox.metadata.xml.AbstractMetaDataHandler
org.jpox.metadata.xml.PersistenceFileMetaDataHandler
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class PersistenceFileMetaDataHandler
- extends AbstractMetaDataHandler
Parser handler for "persistence.xml" files to convert them into a PersistenceFileMetaData.
Implements DefaultHandler and handles the extracting of MetaData from the
XML elements/attributes. This class simply constructs the MetaData representation
mirroring what is in the MetaData file.
Operates the parse process using a Stack. MetaData components are added
to the stack as they are encountered and created. They are then popped off
the stack when the end element is encountered.
- Since:
- 1.1
- Version:
- $Revision: 1.2 $
|
Method Summary |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Handler method called at the end of an element. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Handler method called at the start of an element. |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersistenceFileMetaDataHandler
public PersistenceFileMetaDataHandler(MetaDataManager mgr,
java.lang.String filename,
org.xml.sax.EntityResolver resolver)
- Constructor. Protected to prevent instantiation.
- Parameters:
mgr - the metadata managerfilename - The name of the file to parseresolver - Entity Resolver to use (null if not available)
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
throws org.xml.sax.SAXException
- Handler method called at the start of an element.
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Parameters:
uri - URI of the taglocalName - Local nameqName - Element nameattrs - Attributes for this element
- Throws:
org.xml.sax.SAXException - in parsing errors
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Handler method called at the end of an element.
- Specified by:
endElement in interface org.xml.sax.ContentHandler- Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
- Parameters:
uri - URI of the taglocalName - local nameqName - Name of element just ending
- Throws:
org.xml.sax.SAXException - in parsing errors
Copyright © -2008 . All Rights Reserved.