|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.torque.engine.database.transform.XmlToAppData
A Class that is used to parse an input xml schema file and creates an AppData java structure.
Nested Class Summary | |
private static class |
XmlToAppData.ParseStackElement
When parsing multiple files that use nested |
Field Summary | |
private java.util.Vector |
alreadyReadFiles
remember all files we have already parsed to detect looping. |
private AppData |
app
|
private Column |
currColumn
|
private Database |
currDB
|
private java.lang.String |
currentPackage
|
private java.lang.String |
currentXmlFile
|
private ForeignKey |
currFK
|
private Index |
currIndex
|
private Table |
currTable
|
private Unique |
currUnique
|
private static boolean |
DEBUG
enables debug output |
private java.lang.String |
defaultPackage
|
private java.lang.String |
errorMessage
|
private boolean |
firstPass
|
private boolean |
isExternalSchema
|
private java.util.Stack |
parsingStack
this is the stack to store parsing data |
private static javax.xml.parsers.SAXParserFactory |
saxFactory
|
Constructor Summary | |
XmlToAppData(java.lang.String databaseType,
java.lang.String defaultPackage,
java.lang.String basePropsFilePath)
Creates a new instance for the specified database type. |
Method Summary | |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
Handles closing elements of the xml file. |
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)
Parses a XML input file and returns a newly created and populated AppData structure. |
private void |
printParseError(java.lang.String type,
org.xml.sax.SAXParseException spe)
Write an error to System.err. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
EntityResolver implementation. |
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, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final boolean DEBUG
private AppData app
private Database currDB
private Table currTable
private Column currColumn
private ForeignKey currFK
private Index currIndex
private Unique currUnique
private boolean firstPass
private java.lang.String errorMessage
private boolean isExternalSchema
private java.lang.String currentPackage
private java.lang.String currentXmlFile
private java.lang.String defaultPackage
private static javax.xml.parsers.SAXParserFactory saxFactory
private java.util.Vector alreadyReadFiles
private java.util.Stack parsingStack
Constructor Detail |
public XmlToAppData(java.lang.String databaseType, java.lang.String defaultPackage, java.lang.String basePropsFilePath)
databaseType
- The type of database for the application.defaultPackage
- the default java package used for the ombasePropsFilePath
- The base of the path to the properties
file, including trailing slash.Method Detail |
public AppData parseFile(java.lang.String xmlFile)
xmlFile
- The input file to parse.
xmlFile
.public org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
publicId
- The public identifier of the external entitysystemId
- The system identifier of the external entity
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attributes)
uri
- localName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.rawName
- The qualified name (with prefix), or the empty string if
qualified names are not available.attributes
- The specified or defaulted attributespublic void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName)
uri
- localName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.rawName
- The qualified name (with prefix), or the empty string if
qualified names are not available.public void warning(org.xml.sax.SAXParseException spe)
spe
- The parse exception that caused the callback to be invoked.public void error(org.xml.sax.SAXParseException spe)
spe
- The parse exception that caused the callback to be invoked.public void fatalError(org.xml.sax.SAXParseException spe)
spe
- The parse exception that caused the callback to be invoked.private final void printParseError(java.lang.String type, org.xml.sax.SAXParseException spe)
type
- error typespe
- The parse exception that caused the callback to be invoked.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |