public class Node
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
attributes |
static java.lang.String |
CATEGORY
Main plugin category for plugins which are represented as a configuration node.
|
private java.util.List<Node> |
children |
private java.lang.String |
name |
private java.lang.Object |
object |
private Node |
parent |
private PluginType<?> |
type |
private java.lang.String |
value |
Constructor and Description |
---|
Node() |
Node(Node node) |
Node(Node parent,
java.lang.String name,
PluginType<?> type)
Creates a new instance of
Node and initializes it
with a name and the corresponding XML element. |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAttributes() |
java.util.List<Node> |
getChildren() |
java.lang.String |
getName() |
<T> T |
getObject() |
<T> T |
getObject(java.lang.Class<T> clazz)
Returns this node's object cast to the given class.
|
Node |
getParent() |
PluginType<?> |
getType() |
java.lang.String |
getValue() |
boolean |
hasChildren() |
boolean |
isInstanceOf(java.lang.Class<?> clazz)
Determines if this node's object is an instance of the given class.
|
boolean |
isRoot() |
void |
setObject(java.lang.Object obj) |
void |
setValue(java.lang.String value) |
java.lang.String |
toString() |
public static final java.lang.String CATEGORY
private final Node parent
private final java.lang.String name
private java.lang.String value
private final PluginType<?> type
private final java.util.Map<java.lang.String,java.lang.String> attributes
private final java.util.List<Node> children
private java.lang.Object object
public Node(Node parent, java.lang.String name, PluginType<?> type)
Node
and initializes it
with a name and the corresponding XML element.parent
- the node's parent.name
- the node's name.type
- The Plugin Type associated with the node.public Node()
public Node(Node node)
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
public java.util.List<Node> getChildren()
public boolean hasChildren()
public java.lang.String getValue()
public void setValue(java.lang.String value)
public Node getParent()
public java.lang.String getName()
public boolean isRoot()
public void setObject(java.lang.Object obj)
public <T> T getObject()
public <T> T getObject(java.lang.Class<T> clazz)
T
- the type to cast to.clazz
- the class to cast this node's object to.public boolean isInstanceOf(java.lang.Class<?> clazz)
clazz
- the class to check.true
if this node's object is an instance of the given class.public PluginType<?> getType()
public java.lang.String toString()
toString
in class java.lang.Object