org.apache.turbine.torque.engine.database.transform
Class XmlToAppData

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.apache.turbine.torque.engine.database.transform.XmlToAppData
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

A Class that is used to parse an input xml schema file and creates and AppData java structure. It uses apache Xerces to do the xml parsing.

Version:
$Id$
Author:
Leon Messerschmidt, Jason van Zyl, Martin Poeschl

Field Summary
private  AppData app
           
private  Column currColumn
           
private  Database currDB
           
private  ForeignKey currFK
           
private  Index currIndex
           
private  Table currTable
           
private  Unique currUnique
           
private  java.lang.String errorMessage
           
private  boolean firstPass
           
private  Table foreignTable
           
 
Constructor Summary
XmlToAppData()
          Default custructor
 
Method Summary
 void error(org.xml.sax.SAXParseException spe)
          Error callback.
 void fatalError(org.xml.sax.SAXParseException spe)
          Fatal error callback.
 AppData parseFile(java.lang.String xmlFile)
          Parse and xml input file and returns a newly created and populated AppData structure
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attributes)
          Handles opening elements of the xml file.
 void warning(org.xml.sax.SAXParseException spe)
          Warning callback.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

app

private AppData app

currDB

private Database currDB

currTable

private Table currTable

currColumn

private Column currColumn

currFK

private ForeignKey currFK

currIndex

private Index currIndex

currUnique

private Unique currUnique

firstPass

private boolean firstPass

foreignTable

private Table foreignTable

errorMessage

private java.lang.String errorMessage
Constructor Detail

XmlToAppData

public XmlToAppData()
Default custructor
Method Detail

parseFile

public AppData parseFile(java.lang.String xmlFile)
Parse and xml input file and returns a newly created and populated AppData structure

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String rawName,
                         org.xml.sax.Attributes attributes)
Handles opening elements of the xml file.
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException spe)
Warning callback.
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Throws:
spe - The parse exception that caused the callback to be invoked.

error

public void error(org.xml.sax.SAXParseException spe)
Error callback.
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Throws:
spe - The parse exception that caused the callback to be invoked.

fatalError

public void fatalError(org.xml.sax.SAXParseException spe)
Fatal error callback.
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Throws:
spe - The parse exception that caused the callback to be invoked.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.