Class Node


  • public class Node
    extends java.lang.Object
    A Configuration node.
    • Field Summary

      Fields 
      Modifier and Type Field 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 Summary

      Constructors 
      Constructor 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.
    • 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 final Node parent
      • name

        private final java.lang.String name
      • value

        private java.lang.String value
      • 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 of Node 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

      • 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:
        true if this node's object is an instance of the given class.
        Since:
        2.1
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object