Class Node
- java.lang.Object
-
- org.apache.logging.log4j.core.config.Node
-
public class Node extends Object
A Configuration node.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getAttributes()
List<Node>
getChildren()
String
getName()
<T> T
getObject()
<T> T
getObject(Class<T> clazz)
Returns this node's object cast to the given class.Node
getParent()
PluginType<?>
getType()
String
getValue()
boolean
hasChildren()
boolean
isInstanceOf(Class<?> clazz)
Determines if this node's object is an instance of the given class.boolean
isRoot()
void
setObject(Object obj)
void
setValue(String value)
String
toString()
-
-
-
Field Detail
-
CATEGORY
public static final String CATEGORY
Main plugin category for plugins which are represented as a configuration node. Such plugins tend to be available as XML elements in a configuration file.- Since:
- 2.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Node
public Node(Node parent, String name, PluginType<?> type)
Creates a new instance ofNode
and initializes it with a name and the corresponding XML element.- Parameters:
parent
- the node's parent.name
- the node's name.type
- The Plugin Type associated with the node.
-
Node
public Node()
-
Node
public Node(Node node)
-
-
Method Detail
-
hasChildren
public boolean hasChildren()
-
getValue
public String getValue()
-
setValue
public void setValue(String value)
-
getParent
public Node getParent()
-
getName
public String getName()
-
isRoot
public boolean isRoot()
-
setObject
public void setObject(Object obj)
-
getObject
public <T> T getObject()
-
getObject
public <T> T getObject(Class<T> clazz)
Returns this node's object cast to the given class.- Type Parameters:
T
- the type to cast to.- Parameters:
clazz
- the class to cast this node's object to.- Returns:
- this node's object.
- Since:
- 2.1
-
isInstanceOf
public boolean isInstanceOf(Class<?> clazz)
Determines if this node's object is an instance of the given class.- Parameters:
clazz
- the class to check.- Returns:
true
if this node's object is an instance of the given class.- Since:
- 2.1
-
getType
public PluginType<?> getType()
-
-