|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.dom.Node
org.apache.tapestry5.dom.Document
public final class Document
The root node of a DOM.
| Field Summary | |
|---|---|
static String |
XML_NAMESPACE_URI
XML Namespace URI. |
static String |
XMLNS_NAMESPACE_URI
Namespace used exclusively for defining namespaces. |
| Constructor Summary | |
|---|---|
Document()
Builds with an instance of DefaultMarkupModel. |
|
Document(MarkupModel model)
|
|
Document(MarkupModel model,
String encoding)
|
|
| Method Summary | |
|---|---|
CData |
cdata(String content)
Adds and returns a new CDATA node. |
Document |
comment(String text)
Adds the comment and returns this document for further construction. |
void |
dtd(String name,
String publicId,
String systemId)
Sets the DTD for the document, overriding any prior DTD. |
Element |
find(String path)
Finds an element based on a path of element names. |
Document |
getDocument()
|
Element |
getElementById(String id)
Tries to find an element in this document whose id is specified. |
MarkupModel |
getMarkupModel()
|
protected Map<String,String> |
getNamespaceURIToPrefix()
|
Element |
getRootElement()
|
boolean |
hasDTD()
Returns true if the document has an explicit DTD (set via dtd(String, String, String)). |
Element |
newRootElement(String name)
Creates the root element for this document, replacing any previous root element. |
Element |
newRootElement(String namespace,
String name)
Creates a new root element within a namespace. |
Document |
raw(String text)
Adds the raw text and returns this document for further construction. |
Text |
text(String text)
Adds and returns a new text node (the text node is returned so that Text.write(String) or [@link
Text.writef(String, Object[]) may be invoked. |
void |
toMarkup(Document document,
PrintWriter writer,
Map<String,String> namespaceURIToPrefix)
Implemented by each subclass, with the document passed in for efficiency. |
| Methods inherited from class org.apache.tapestry5.dom.Node |
|---|
getContainer, moveAfter, moveBefore, moveToBottom, moveToTop, remove, toMarkup, toString, wrap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String XML_NAMESPACE_URI
public static final String XMLNS_NAMESPACE_URI
| Constructor Detail |
|---|
public Document(MarkupModel model)
public Document(MarkupModel model,
String encoding)
public Document()
DefaultMarkupModel.
| Method Detail |
|---|
public Document getDocument()
getDocument in class Nodepublic Element find(String path)
path - slash separated series of element names
Element.find(String)public MarkupModel getMarkupModel()
public Element newRootElement(String name)
public Element newRootElement(String namespace,
String name)
namespace - URI of namespace containing the elementname - name of element with namespace
public void toMarkup(Document document,
PrintWriter writer,
Map<String,String> namespaceURIToPrefix)
Node
public Element getRootElement()
public Element getElementById(String id)
id - the value of the id attribute of the element being looked for
public void dtd(String name,
String publicId,
String systemId)
name - non-blank name of document type (i.e., "html")publicId - optionalsystemId - optionalpublic boolean hasDTD()
dtd(String, String, String)).
protected Map<String,String> getNamespaceURIToPrefix()
getNamespaceURIToPrefix in class Nodepublic Document comment(String text)
public Document raw(String text)
public Text text(String text)
Text.write(String) or [@link
Text.writef(String, Object[]) may be invoked.
text - initial text for the node
public CData cdata(String content)
content - the content to be rendered by the node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||