|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface XmlNode
Base interface for all nodes in an XML document.
XmlDocument| Field Summary |
|---|
| Method Summary | ||
|---|---|---|
XmlNode |
addChild(String tagName)
Adds an instance of the specified child class to this node. |
|
String |
getAttribute(String attribute)
Convenient method to get the value of an attribute. |
|
Collection<String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node. |
|
|
getChildNodes(Class<T> tagClass)
Return a collection of child nodes with the specified tag class. |
|
|
getChildren()
Return a collection of all child nodes. |
|
Node |
getNode()
Retrieves the encapsulated node. |
|
String |
getTagName()
Retrieves the name of the tag for the derived node. |
|
XmlNode |
newInstance(Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node. |
|
void |
setAttribute(String name,
String value)
Convenient method to set the value of an attribute. |
|
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
| Method Detail |
|---|
Node getNode()
String getTagName()
XmlNode newInstance(Node n,
XmlNodeFactory<? extends XmlNode> factory)
Each XmlNode can serve as a prototype in a
XmlNodeFactory to produce a collection of
child nodes. Factories can then use the prototype pattern to
produce new nodes.
n - The node to encapsulate.factory - the factroy that calls this method.
XmlNodeFactoryXmlNode addChild(String tagName)
tagName - the tag name of the node to add without any attributes.
String getAttribute(String attribute)
attribute - Name of the attribute.
null if the value of the
attribute cannot be retrieved.
void setAttribute(String name,
String value)
null then the attribute is removed.
name - Name of the attribute.value - New value of the attribute or null to remove the
attribute.Collection<String> getAttributeNames()
<T extends XmlNode> Collection<T> getChildNodes(Class<T> tagClass)
T - Type of the child nodes.tagClass - Class of child node to return.
<T extends XmlNode> Collection<T> getChildren()
T - Type of the child nodes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||