|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.theloutons.search.utils.XHTMLviaDOM
This class has the object of creating an empty XHTML DOM object and then has methods to add tags of various sorts. There is a method to write it to a file. It can be instantiated via file (a sort of template) or string (name of a file) or null and then it starts from scratch.
Constructor Summary | |
XHTMLviaDOM()
just creates an empty structured XHTM file |
|
XHTMLviaDOM(java.io.File f)
this reads in |
|
XHTMLviaDOM(java.lang.String fName)
|
Method Summary | |
org.w3c.dom.Node |
addAttribs(org.w3c.dom.Node nd,
java.util.Properties attribs)
|
void |
addForm(java.util.Properties attribs,
java.lang.String url)
/* sets up a form, needed to get info back to the servlet |
org.w3c.dom.Node |
addInputButton(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs)
Adds an inputbutton to the document where one wishes. |
org.w3c.dom.Node |
addInputCkBox(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs,
boolean cked)
This adds an check box to the nd (if nd null, to the form) tag and gives it some standard attributes needed. |
org.w3c.dom.Node |
addInputPassWd(org.w3c.dom.Node nd,
java.lang.String name,
java.util.Properties attribs)
this adds an input to the nd (if nd null, to the form) tag and gives it some standard attributes needed. |
org.w3c.dom.Node |
addInputRadio(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs,
boolean cked)
This adds an input to the nd (if nd null, to the form) tag and gives it some standard attributes needed. |
org.w3c.dom.Node |
addInputReset(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs)
This adds a reset button to the nd (if nd null, to the form) tag and gives it some standard attributes needed. |
org.w3c.dom.Node |
addInputSubmit(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs)
This adds a submitt button |
org.w3c.dom.Node |
addInputText(org.w3c.dom.Node nd,
java.lang.String name,
java.lang.String value,
java.util.Properties attribs)
Adds a general text entry field to the node nd (or form if nd is null) |
org.w3c.dom.Node |
addKnot(org.w3c.dom.Node nd,
java.lang.String nodeName,
java.util.Properties attribs,
java.lang.String contents)
/* adds a node to the dom. |
boolean |
addMeta(java.util.Properties meta)
it is the resposibility of the user to get the properties correctly. |
void |
addStyles(java.lang.String isEverything)
adds styles to the css |
void |
addStylesComment(java.lang.String isEverything)
This just adds a comment to the styles tage |
org.w3c.dom.Node |
getBody()
gets the body node (body tag) |
org.w3c.dom.Node |
getForm()
|
boolean |
writeDOMtoFile(java.lang.String fName)
The method writes the xhtml document to a file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XHTMLviaDOM()
public XHTMLviaDOM(java.io.File f)
f
- is the name of the file to be read in. If it does
not exist or cannot be read an empty dom is created.public XHTMLviaDOM(java.lang.String fName)
fName
- the name of the file to be read in as templateMethod Detail |
public org.w3c.dom.Node addKnot(org.w3c.dom.Node nd, java.lang.String nodeName, java.util.Properties attribs, java.lang.String contents)
nd
- is the node into which this will be writtennodeName
- the name of the new node Stringattribs
- Java Properties contaings the atributes.
The attribute name is the name of the property and
the value is the value of the key.contents
- String, the value of the node.
public org.w3c.dom.Node addAttribs(org.w3c.dom.Node nd, java.util.Properties attribs)
public void addStylesComment(java.lang.String isEverything)
isEverything
- the contents of the commentpublic void addStyles(java.lang.String isEverything)
isEverything
- A String the styles to append CSSpublic boolean addMeta(java.util.Properties meta)
meta
- is a properties contianing name and content of the meta data
public void addForm(java.util.Properties attribs, java.lang.String url)
attribs
- a set of attribs for the formurl
- the address to be returned by the do get/put HTTP protocolpublic org.w3c.dom.Node addInputText(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs)
nd
- the node in which to put the inputname
- the name of the text nodevalue
- the node valueattribs
- list of attribs as a Java properties
public org.w3c.dom.Node addInputPassWd(org.w3c.dom.Node nd, java.lang.String name, java.util.Properties attribs)
nd
- the node to which it is writtenname
- the name of the new nodeattribs
- attributes as Java Properties
public org.w3c.dom.Node addInputRadio(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs, boolean cked)
nd
- the node to which to add the radio buttonname
- the name of the buttonvalue
- the value value fieldattribs
- Java attribs containing attributes for the
buttoncked
- true if the button is to be checked. If on has
more than one button marked as checked, then the first is.
public org.w3c.dom.Node addInputCkBox(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs, boolean cked)
nd
- the node to which to add the check boxname
- the name of the check boxvalue
- the value for the value attributeattribs
- extra attribues (as Java Properties)cked
- true if to be checked.
public org.w3c.dom.Node addInputReset(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs)
nd
- the node to which to add the reset button or the if null the formname
- the name of the reset buttonvalue
- the string value for the value attributeattribs
- extra attributes for this button
public org.w3c.dom.Node addInputSubmit(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs)
nd
- the node to which to add the button (usuall in a form)name
- the String containing the name of the buttonvalue
- value for the value attribute.attribs
- extra attributes as Java Properties.
public org.w3c.dom.Node addInputButton(org.w3c.dom.Node nd, java.lang.String name, java.lang.String value, java.util.Properties attribs)
nd
- the node to which the button is to be added.name
- the name of the button (String)value
- the value of the value attributeattribs
- extra attributes (Java Properties)
public org.w3c.dom.Node getBody()
public org.w3c.dom.Node getForm()
public boolean writeDOMtoFile(java.lang.String fName)
fName
- the name of the file to be written
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |