|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.input.XMLJDomParser
ch.sahits.codegen.java.gui.input.XHTMLModelParser
public final class XHTMLModelParser
This parser generates a IJavaForm model from a XHTML file.
This parser can generate a model for a two or three column layout
if they are of the form of testForm2Col.xhtml.
A flow layout is also possible. For an example see
testForm1Col.xhtml.
Since a flow layout is unstructured, there are some constraints that are known. There
my be others. If you come across an undocumented case check it out, and either add the case
here or improve the parsing that it works.
Known issues:
| Field Summary |
|---|
| Fields inherited from class ch.sahits.codegen.input.XMLJDomParser |
|---|
document, root |
| Constructor Summary | |
|---|---|
XHTMLModelParser()
|
|
| Method Summary | |
|---|---|
protected java.util.List<Element> |
collectRadioFields(Element parent,
java.lang.String radioGroupName)
Collect all radio buttons that are in the subtree of parent
that belong to one and the same group |
java.lang.String |
getFileExtension()
This class can parse XHTML files |
java.lang.String |
getParserName()
Retrieve the name of this class |
int |
getRanking()
This method rates the implementation. |
int |
getWorkload()
Defines how complex the generation of the model is. |
protected boolean |
hasChild(Element elem,
java.lang.String[] childNames)
Check whether any of the elements children are of at least a given type |
protected boolean |
hasFormField(Element elem)
Check if the element has a form field as a child. |
boolean |
hasTextWithFormField(Element elem)
Check wether there is some form field with some text |
void |
init(java.lang.String inputFile)
Since the namespace must be validated a connection error to the namespace can result in quircky errors that make no sense what so ever. |
protected boolean |
isFormField(Content elem)
Check whether an element is of type form field. |
protected boolean |
isTextNode(Content cont)
Check wether the element node is some sort of text node. |
EDBConnectionData |
needsDataBaseInformationForCompleetion()
Indicate if the input file is self contained or if for compleetion of the model information from the second page is needed. |
IGeneratedJavaClass |
parse()
Create a model object |
| Methods inherited from class ch.sahits.codegen.input.XMLJDomParser |
|---|
getAllAttributes, getAllElements, getAttributeValue, getFirstElement, getPredecessor, hasChild, hasChild, hasText, lookup, setNamespace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XHTMLModelParser()
| Method Detail |
|---|
public void init(java.lang.String inputFile)
throws java.lang.Exception
init in interface IInputParserinit in class XMLJDomParserinputFile - Input parser
java.lang.Exception - one of the following
java.io.IOException - Could not read from input file
java.net.MalformedURLException - malformed input filepublic java.lang.String getParserName()
getParserName in class XMLJDomParserpublic java.lang.String getFileExtension()
getFileExtension in interface IInputParsergetFileExtension in class XMLJDomParserpublic IGeneratedJavaClass parse()
parse in interface IInputParserparse in class XMLJDomParser
protected boolean hasChild(Element elem,
java.lang.String[] childNames)
elem - element to be checkedchildNames - array of accepted child names
XMLJDomParser.hasChild(Element, String)protected boolean hasFormField(Element elem)
elem - element to be checked
protected boolean isFormField(Content elem)
elem - element to be checked
public boolean hasTextWithFormField(Element elem)
elem - Element to be checked
protected boolean isTextNode(Content cont)
cont - Content element to be checked to be checked (Should be either of type Text or Element
protected java.util.List<Element> collectRadioFields(Element parent,
java.lang.String radioGroupName)
parent
that belong to one and the same group
parent - node to start the searchradioGroupName - name of the radio group
public int getWorkload()
getWorkload in interface IInputParserpublic int getRanking()
getRanking in interface IInputParsergetRanking in class XMLJDomParserpublic EDBConnectionData needsDataBaseInformationForCompleetion()
needsDataBaseInformationForCompleetion in interface IInputParser
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||