|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.util.DOMBuilder
Document builder class. This class provides an intuitive interface for incrementally building DOM documents.
Constructor Summary | |
DOMBuilder(String name)
Creates a builder for a new DOM document. |
Method Summary | |
void |
addContent(String content)
Adds the given string as text content to the current element. |
void |
addContentElement(String name,
String content)
Adds a new child element with the given name and text content. |
void |
endElement()
Makes the parent element current. |
void |
setAttribute(String name,
boolean value)
Sets the named boolean attribute of the current element. |
void |
setAttribute(String name,
String value)
Sets the named attribute of the current element. |
void |
startElement(String name)
Creates a new element with the given name as the child of the current element and makes the created element current. |
void |
write(OutputStream xml)
Writes the document built by this builder into the given output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DOMBuilder(String name) throws ParserConfigurationException
name
- name of the root element
ParserConfigurationException
- if a document cannot be createdMethod Detail |
public void write(OutputStream xml) throws IOException
xml
- XML output stream
IOException
- if the document could not be writtenpublic void startElement(String name)
endElement
method needs to be called
to return back to the original element.
name
- name of the new elementpublic void endElement()
startElement
method has been fully
built.
public void setAttribute(String name, String value)
name
- attribute namevalue
- attribute valuepublic void setAttribute(String name, boolean value)
name
- attribute namevalue
- boolean attribute valuepublic void addContent(String content)
content
- text contentpublic void addContentElement(String name, String content)
name
- child element namecontent
- child element content
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |