org.apache.turbine.services.intake.transform
Class XmlToAppData

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--org.apache.turbine.services.intake.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:
Field Summary
private  AppData app
           
private  java.lang.String currElement
           
private  XmlField currField
           
private  XmlGroup currGroup
           
private  Rule currRule
           
 
Constructor Summary
XmlToAppData()
          Default custructor
 
Method Summary
 void characters(char[] mesgArray, int start, int length)
          Handles the character data, which we are using to specify the error message.
 void error(org.xml.sax.SAXParseException spe)
          Callback function for the xml parser to give errors.
 void fatalError(org.xml.sax.SAXParseException spe)
          Callback function for the xml parser to give fatalErrors.
 AppData parseFile(java.lang.String xmlFile)
          Parse and xml input file and returns a newly created and populated AppData structure
 AppData parseFile(java.lang.String xmlFile, boolean skipValidation)
          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)
          Callback function for the xml parser to give warnings.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
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

currGroup

private XmlGroup currGroup

currField

private XmlField currField

currRule

private Rule currRule

currElement

private java.lang.String currElement
Constructor Detail

XmlToAppData

public XmlToAppData()
Default custructor
Method Detail

parseFile

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

parseFile

public AppData parseFile(java.lang.String xmlFile,
                         boolean skipValidation)
                  throws java.lang.Exception
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

characters

public void characters(char[] mesgArray,
                       int start,
                       int length)
Handles the character data, which we are using to specify the error message.
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException spe)
Callback function for the xml parser to give warnings.
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - a SAXParseException value

error

public void error(org.xml.sax.SAXParseException spe)
Callback function for the xml parser to give errors.
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - a SAXParseException value

fatalError

public void fatalError(org.xml.sax.SAXParseException spe)
Callback function for the xml parser to give fatalErrors.
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Parameters:
spe - a SAXParseException value


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