ch.sahits.codegen.java.input
Class XMLTableParser

java.lang.Object
  extended by ch.sahits.codegen.input.XMLJDomParser
      extended by ch.sahits.codegen.java.input.XMLTableParser
All Implemented Interfaces:
IInputParser, IXMLInputFileParser, IXMLJavaInputFileParser

public final class XMLTableParser
extends XMLJDomParser
implements IXMLJavaInputFileParser

This XML parser can parse an XML file that represents a database table.

Since:
0.9.3 TODO Replace IGeneratedJavaClass with IGeneratedJavaClass2
Author:
Andi Hotz

Field Summary
 
Fields inherited from class ch.sahits.codegen.input.XMLJDomParser
document, root
 
Constructor Summary
XMLTableParser()
          Default constructor
XMLTableParser(java.lang.String inputFile)
          Initialize the parser with the input file
 
Method Summary
 IGeneratedJavaClass generateModel(java.lang.String className, java.lang.String packageName, boolean isPublic, boolean isAbstract, boolean isFinal)
          Convert the XML file into a model object
 int getWorkload()
          Defines how complex the generation of the model is.
 void init(java.lang.String path2XML)
          Initialize the XML file for parsing
 boolean isInitialized()
          Check whether the the object is properly initialized
 EDBConnectionData needsDataBaseInformationForCompleetion()
          Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed.
 
Methods inherited from class ch.sahits.codegen.input.XMLJDomParser
getAllAttributes, getAllElements, getAttributeValue, getFileExtension, getFirstElement, getParserName, getPredecessor, getRanking, hasChild, hasChild, hasText, lookup, parse, setNamespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.sahits.codegen.java.input.IXMLJavaInputFileParser
parse
 
Methods inherited from interface ch.sahits.codegen.input.IInputParser
getFileExtension, getRanking
 

Constructor Detail

XMLTableParser

public XMLTableParser(java.lang.String inputFile)
               throws JDOMException,
                      java.io.IOException
Initialize the parser with the input file

Parameters:
inputFile - input XML file
Throws:
java.io.IOException
JDOMException

XMLTableParser

public XMLTableParser()
Default constructor

Method Detail

init

public void init(java.lang.String path2XML)
Initialize the XML file for parsing

Specified by:
init in interface IInputParser
Overrides:
init in class XMLJDomParser
Parameters:
path2XML - absolute path to the XML file

isInitialized

public boolean isInitialized()
Check whether the the object is properly initialized

Specified by:
isInitialized in interface IXMLInputFileParser
Returns:
true if initialization occurred with the constructor

generateModel

public IGeneratedJavaClass generateModel(java.lang.String className,
                                         java.lang.String packageName,
                                         boolean isPublic,
                                         boolean isAbstract,
                                         boolean isFinal)
Convert the XML file into a model object

Specified by:
generateModel in interface IXMLJavaInputFileParser
Parameters:
className - name of the class to be generated
packageName - Name of the package the class resides in
isPublic - is the class bublic
isAbstract - is the class abstract
isFinal - is the class final
Returns:
DataBaseTable model

getWorkload

public int getWorkload()
Defines how complex the generation of the model is.

Specified by:
getWorkload in interface IInputParser
Returns:
Number of work steps

needsDataBaseInformationForCompleetion

public EDBConnectionData needsDataBaseInformationForCompleetion()
Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed.

Specified by:
needsDataBaseInformationForCompleetion in interface IInputParser
Returns: