|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xmlgen.XMLGenerator
Contains the methods necessary to create a XML document for display on the web or for use by another application.
Constructor Summary | |
XMLGenerator()
Constructor that initializes a new StringBuffer |
Method Summary | |
void |
addData(java.sql.ResultSet rs,
java.lang.String dataType)
Loops through the ResultSet and converts the records to XML data elements |
void |
addElement(java.lang.String elementName,
java.lang.String elementValue)
Allows for one element at a time to be added to the XML |
void |
addInput(java.lang.String inputType,
java.lang.String inputName,
int inputValue)
Prints the XML tags that are used to generate a HTML form element |
void |
addInput(java.lang.String inputType,
java.lang.String inputName,
java.lang.String inputValue)
Prints the XML tags that are used to generate a HTML form element |
void |
addInput(java.lang.String inputType,
java.lang.String inputName,
java.lang.String inputValue,
java.lang.String onClick)
Prints the XML tags that are used to generate a HTML form element (button type) |
void |
addScript(java.lang.String scriptLanguage,
java.lang.String scriptOps)
Allows for a script to be added into the XML document (i.e. |
java.lang.String |
format(java.lang.String input)
Determines if the string is a decimal number and truncates all decimal values to the desired precision length. |
void |
printBeginForm(java.lang.String formName,
java.lang.String formMethod,
java.lang.String formAction)
Prints the start tag and parameters of the form section |
void |
printBeginRoot(java.lang.String rootElement)
Creates the strating root element tag. |
void |
printEndForm()
Prints the end tag of the form section |
void |
printEndRoot(java.lang.String rootElement)
Closes the root element tag. |
void |
printStylesheet(java.lang.String stylesheet)
Prints the stylesheet line in the XML document, allowing to format the data for output |
void |
printXMLHeader()
Prints the XML tag necessary at the beginning of the XML document |
void |
setFormat(boolean format)
Method to set formatting flag used to determine if decimal values should be set to a specific precision |
java.lang.String |
toXML()
Converts the StringBuffer object to a string wich the servlet can display |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLGenerator()
Method Detail |
public void printXMLHeader()
public void printStylesheet(java.lang.String stylesheet)
stylesheet
- the name of the stylesheet to referencepublic void printBeginRoot(java.lang.String rootElement)
rootElement
- the name of the root elementpublic void printEndRoot(java.lang.String rootElement)
rootElement
- the name of the root elementpublic void addData(java.sql.ResultSet rs, java.lang.String dataType) throws java.sql.SQLException
rs
- the ResultSet data to be displayed as XMLdataType
- the type of data, which is then used as a encapsulating XML elementjava.sql.SQLException
- error thrown when something is wrong with the ResultSetpublic void addElement(java.lang.String elementName, java.lang.String elementValue)
elementName
- the name of the element to be addedelementValue
- the value of the element to be addedpublic void addScript(java.lang.String scriptLanguage, java.lang.String scriptOps)
scriptLanguage
- the scripting language being usedscriptOps
- the JavaScript variables and methods to be embedded in the webpagepublic void printBeginForm(java.lang.String formName, java.lang.String formMethod, java.lang.String formAction)
formName
- the name of the HTML formformMethod
- the method of the HTML form, either 'get' or 'post'formAction
- the URL the form will be submitted topublic void printEndForm()
public void addInput(java.lang.String inputType, java.lang.String inputName, java.lang.String inputValue)
inputType
- the input type of the form elementinputName
- the name of the form elementinputValue
- the value of the form elementpublic void addInput(java.lang.String inputType, java.lang.String inputName, int inputValue)
inputType
- the input type of the form elementinputName
- the name of the form elementinputValue
- the value of the form elementpublic void addInput(java.lang.String inputType, java.lang.String inputName, java.lang.String inputValue, java.lang.String onClick)
inputType
- the input type of the form elementinputName
- the name of the form elementinputValue
- the value of the form elementonClick
- the action to be performed when the button is clickedpublic java.lang.String toXML()
public void setFormat(boolean format)
format
- formatting on/off indicatorpublic java.lang.String format(java.lang.String input)
input
- the data value string
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |