|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jolene.dom.Document
public final class Document
HTML Document object.
Constructor Summary | |
---|---|
Document(java.lang.String fileName)
|
|
Document(java.lang.String fileName,
java.lang.String contextPath,
java.lang.String uri)
|
Method Summary | |
---|---|
boolean |
addHeader(Header header)
Adds a header element to the document. |
Document |
clone()
This is a custom clone implementation which ensures the document is cleanly and safely cloned. |
HTMLElement |
elements(java.lang.String id)
Returns a object by searching all forms in the document. |
Form |
forms(int index)
Returns the form object specified by the number. |
Form |
forms(java.lang.String name)
Returns a form object specified by name. |
IAttributes |
getBody()
Retrives the body attributes. |
java.lang.String |
getDoctype()
Gets the doc type of the document. |
int |
getFormCount()
|
int |
getHeaderCount()
Returns the number of Header elements in the document. |
java.lang.String |
getTitle()
Gets the document title. |
java.lang.String |
getUri()
|
Header |
headers(int header)
Return the Header element specified by the index based on document order. |
boolean |
isTranslated()
Indicator for labels being translated. |
Header |
removeHeader(int index)
Remove the headers |
void |
setDoctype(java.lang.String doctype)
Sets the doc type of the document. |
void |
setTitle(java.lang.String string)
Set the document title. |
void |
setTranslated(boolean translated)
Indicator for labels being translated. |
void |
stream(java.lang.String filename)
Writes the document to the specified fileName. |
void |
stream(java.io.Writer out)
Writes the document to the specified Writer object and closes the Writer. |
java.lang.String |
toString()
Returns the document file name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Document(java.lang.String fileName, java.lang.String contextPath, java.lang.String uri) throws java.io.IOException, MalformedHTMLException
fileName
- contextPath
- uri
-
java.io.IOException
MalformedHTMLException
- - runtime exceptionpublic Document(java.lang.String fileName) throws java.io.IOException, MalformedHTMLException
fileName
- - file name of the document.
java.io.IOException
- - if an IOException occurs
MalformedHTMLException
- - runtime exceptionMethod Detail |
---|
public boolean addHeader(Header header)
header
- a Header object.
public Document clone()
clone
in class java.lang.Object
public HTMLElement elements(java.lang.String id)
id
- The id of the element.
public Form forms(int index)
index
- form number (starting with 0)
java.lang.IndexOutOfBoundsException
- - if the index is out of range (index < 0 || index >= size()).public Form forms(java.lang.String name)
name
- name of the form in the document (case insensitive).
public IAttributes getBody()
public java.lang.String getDoctype()
public int getFormCount()
public int getHeaderCount()
public java.lang.String getTitle()
public java.lang.String getUri()
public Header headers(int header)
header
- to the Header (starting with 0).
public boolean isTranslated()
public Header removeHeader(int index)
index
- to the header in the document. Zero based in document order.
public void setDoctype(java.lang.String doctype)
doctype
- The HTML doctype string.public void setTitle(java.lang.String string)
string
- The document title.public void setTranslated(boolean translated)
translated
- set to true if the doc has been translated.public void stream(java.lang.String filename) throws java.io.IOException
filename
- The filename to write to.
java.io.IOException
- if there's an IOExceptionpublic void stream(java.io.Writer out) throws java.io.IOException
out
- an output Writer to write to.
java.io.IOException
- it there's an IOExceptionpublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |