com.objectwave.persist.xml
Class XMLDecoder

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.objectwave.persist.xml.XMLDecoder
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class XMLDecoder
extends org.xml.sax.helpers.DefaultHandler

Read the XML file to find the all the mapping information

Version:
1.4: XMLDecoder.java,v 1.3 2001/01/26 20:57:09 dhoag Exp $
Author:
Zhou Cai

Nested Class Summary
static class XMLDecoder.Test
          Unit Test
 
Constructor Summary
XMLDecoder(java.lang.String uri, java.lang.Class classInstance)
          Constructor
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String local, java.lang.String raw)
          This method will parse the collection in an XML document.
protected  java.lang.Class forName(java.lang.String className)
           
 boolean getBrokerGeneratedPrimaryKeys()
           
 java.util.ArrayList getMaps()
          Gets the Maps attribute of the XMLDecoder object
 java.lang.String getTableName()
          Gets the TableName attribute of the XMLDecoder object
protected  void setParserFeature(org.xml.sax.XMLReader rdr, java.lang.String prop, boolean value)
          Try to set the parser property, but don't bomb out if we fail
 void startElement(java.lang.String uri, java.lang.String local, java.lang.String raw, org.xml.sax.Attributes attrs)
          This method will parse a single element in an XML document.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, error, 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

XMLDecoder

public XMLDecoder(java.lang.String uri,
                  java.lang.Class classInstance)
           throws ConfigurationException
Constructor

Parameters:
uri - The XML file name
classInstance - The class for matching Field
Throws:
ConfigurationException
Method Detail

setParserFeature

protected void setParserFeature(org.xml.sax.XMLReader rdr,
                                java.lang.String prop,
                                boolean value)
Try to set the parser property, but don't bomb out if we fail

Parameters:
rdr - The new ParserFeature value
prop - The new ParserFeature value
value - The new ParserFeature value

getTableName

public java.lang.String getTableName()
Gets the TableName attribute of the XMLDecoder object

Returns:
The TableName value

getBrokerGeneratedPrimaryKeys

public boolean getBrokerGeneratedPrimaryKeys()
Returns:
int

getMaps

public java.util.ArrayList getMaps()
Gets the Maps attribute of the XMLDecoder object

Returns:
The Maps value

startElement

public void startElement(java.lang.String uri,
                         java.lang.String local,
                         java.lang.String raw,
                         org.xml.sax.Attributes attrs)
This method will parse a single element in an XML document. It is called automatically by the XML Parser.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
uri - String The Namespace URI
local - String The local name (without prefix)
raw - String The raw XML 1.0 name (with prefix)
attrs - Attributes The attributes attached to the element.

endElement

public void endElement(java.lang.String uri,
                       java.lang.String local,
                       java.lang.String raw)
This method will parse the collection in an XML document. It is called automatically by the XML Parser.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
uri - String The Namespace URI
local - String The local name (without prefix)
raw - String The raw XML 1.0 name (with prefix)

forName

protected java.lang.Class forName(java.lang.String className)
                           throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException