Class Node
- java.lang.Object
-
- org.apache.logging.log4j.core.config.Node
-
public class Node extends java.lang.ObjectA Configuration node.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>attributesstatic java.lang.StringCATEGORYMain plugin category for plugins which are represented as a configuration node.private java.util.List<Node>childrenprivate java.lang.Stringnameprivate java.lang.Objectobjectprivate Nodeparentprivate PluginType<?>typeprivate java.lang.Stringvalue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getAttributes()java.util.List<Node>getChildren()java.lang.StringgetName()<T> TgetObject()<T> TgetObject(java.lang.Class<T> clazz)Returns this node's object cast to the given class.NodegetParent()PluginType<?>getType()java.lang.StringgetValue()booleanhasChildren()booleanisInstanceOf(java.lang.Class<?> clazz)Determines if this node's object is an instance of the given class.booleanisRoot()voidsetObject(java.lang.Object obj)voidsetParent(Node parent)voidsetValue(java.lang.String value)java.lang.StringtoString()
-
-
-
Field Detail
-
CATEGORY
public static final java.lang.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
-
parent
private Node parent
-
name
private final java.lang.String name
-
value
private java.lang.String value
-
type
private final PluginType<?> type
-
attributes
private final java.util.Map<java.lang.String,java.lang.String> attributes
-
children
private final java.util.List<Node> children
-
object
private java.lang.Object object
-
-
Constructor Detail
-
Node
public Node(Node parent, java.lang.String name, PluginType<?> type)
Creates a new instance ofNodeand 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
-
setParent
public void setParent(Node parent)
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
-
getChildren
public java.util.List<Node> getChildren()
-
hasChildren
public boolean hasChildren()
-
getValue
public java.lang.String getValue()
-
setValue
public void setValue(java.lang.String value)
-
getParent
public Node getParent()
-
getName
public java.lang.String getName()
-
isRoot
public boolean isRoot()
-
setObject
public void setObject(java.lang.Object obj)
-
getObject
public <T> T getObject()
-
getObject
public <T> T getObject(java.lang.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(java.lang.Class<?> clazz)
Determines if this node's object is an instance of the given class.- Parameters:
clazz- the class to check.- Returns:
trueif this node's object is an instance of the given class.- Since:
- 2.1
-
getType
public PluginType<?> getType()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-