org.apache.torque.engine.database.transform
Class XmlToData

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.apache.torque.engine.database.transform.XmlToData
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XmlToData
extends DefaultHandler
implements EntityResolver

A Class that is used to parse an input xml schema file and creates and AppData java structure.

Version:
$Id: XmlToData.java,v 1.1 2007-10-21 07:57:26 abyrne Exp $
Author:
Leon Messerschmidt, Jason van Zyl, Martin Poeschl, Fedor Karpelevitch

Nested Class Summary
 class XmlToData.ColumnValue
           
 class XmlToData.DataRow
           
 
Constructor Summary
XmlToData(Database database, String dtdFilePath)
          Default custructor
 
Method Summary
 InputSource getInputSource(String urlString)
          get an InputSource for an URL String
 List<?> parseFile(String xmlFile)
           
 InputSource resolveEntity(String publicId, String systemId)
          called by the XML parser
 void startElement(String uri, String localName, String rawName, Attributes attributes)
          Handles opening elements of the xml file.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, 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
 

Constructor Detail

XmlToData

public XmlToData(Database database,
                 String dtdFilePath)
          throws MalformedURLException,
                 IOException
Default custructor

Throws:
MalformedURLException
IOException
Method Detail

parseFile

public List<?> parseFile(String xmlFile)
                  throws Exception
Throws:
Exception

startElement

public void startElement(String uri,
                         String localName,
                         String rawName,
                         Attributes attributes)
                  throws SAXException
Handles opening elements of the xml file.

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

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException
called by the XML parser

Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Returns:
an InputSource for the database.dtd file
Throws:
SAXException

getInputSource

public InputSource getInputSource(String urlString)
                           throws IOException
get an InputSource for an URL String

Parameters:
urlString -
Returns:
an InputSource for the URL String
Throws:
IOException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.