|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opt4j.core.config.JNode
public class JNode
Wrapper for Node elements. This class integrates Java 5
functionality with generics.
| Field Summary | |
|---|---|
protected org.w3c.dom.Node |
node
|
| Constructor Summary | |
|---|---|
JNode(org.w3c.dom.Document document,
java.lang.String name)
Constructs a new JNode for a Document. |
|
JNode(org.w3c.dom.Node node)
Creates a Wrapper JNode for a Node element. |
|
| Method Summary | |
|---|---|
JNode |
appendChild(JNode jNode)
Append a JNode. |
JNode |
appendChild(org.w3c.dom.Node node)
Append an XML Node. |
JNode |
appendChild(java.lang.String name)
Append a new JNode with a given name. |
java.lang.String |
getAttribute(java.lang.String attribute)
Returns the value of an attribute. |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a Map of all attributes. |
JNode |
getChild()
Returns the first child. |
JNode |
getChild(java.lang.String name)
Returns the first child with a specified name. |
java.util.List<JNode> |
getChildren()
Returns all children. |
java.util.List<JNode> |
getChildren(java.lang.String name)
Returns all children with a specified name. |
org.w3c.dom.Document |
getDocument()
Returns the owner Document. |
java.lang.String |
getName()
Returns the name. |
org.w3c.dom.Node |
getNode()
Retrieves the Node element. |
java.lang.String |
getText()
Returns the strings content. |
boolean |
hasAttribute(java.lang.String attribute)
Returns true if the attribute is existent. |
boolean |
hasText()
Returns true if this node has a strings content. |
void |
setAttribute(java.lang.String attribute,
java.lang.String value)
Sets an attribute to a value. |
void |
setText(java.lang.String text)
Sets the strings content. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.w3c.dom.Node node
| Constructor Detail |
|---|
public JNode(org.w3c.dom.Node node)
JNode for a Node element.
node - the node to wrap
public JNode(org.w3c.dom.Document document,
java.lang.String name)
JNode for a Document.
document - the XML documentname - the specified name of the node| Method Detail |
|---|
public org.w3c.dom.Node getNode()
Node element.
public java.lang.String getName()
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Map of all attributes.
public java.lang.String getAttribute(java.lang.String attribute)
attribute - the name of the attribute
setAttribute(java.lang.String, java.lang.String)public boolean hasAttribute(java.lang.String attribute)
true if the attribute is existent.
attribute - the name of the attribute
public JNode getChild()
public JNode getChild(java.lang.String name)
name - the name of the child
public java.util.List<JNode> getChildren()
public java.util.List<JNode> getChildren(java.lang.String name)
name - the name of the children
public java.lang.String getText()
setText(java.lang.String)public boolean hasText()
true if this node has a strings content.
true if this node has a strings contentpublic void setText(java.lang.String text)
text - the strings content to setgetText()
public void setAttribute(java.lang.String attribute,
java.lang.String value)
attribute - the name of the attributevalue - the valuegetAttribute(java.lang.String)public JNode appendChild(java.lang.String name)
JNode with a given name.
name - the specified name
public JNode appendChild(org.w3c.dom.Node node)
Node.
node - the XML node
public JNode appendChild(JNode jNode)
JNode.
jNode - the node to append
public org.w3c.dom.Document getDocument()
Document.
public 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 | ||||||||