Class XMLBeanDeclaration.NodeData<T>

  • Type Parameters:
    T - the type of the node
    Enclosing class:
    XMLBeanDeclaration

    static class XMLBeanDeclaration.NodeData<T>
    extends java.lang.Object
    An internal helper class which wraps the node with the bean declaration and the corresponding node handler.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T node
      The wrapped node.
      private NodeHandler<T> nodeHandler
      The node handler for interacting with this node.
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeData​(T node, NodeHandler<T> nodeHandler)
      Constructs a new instance of NodeData.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String escapedNodeName​(HierarchicalConfiguration<?> config)
      Returns the unescaped name of the node stored in this data object.
      (package private) java.lang.Object getAttribute​(java.lang.String key)
      Gets the value of the attribute with the given name of the wrapped node.
      (package private) java.util.Set<java.lang.String> getAttributes()
      Gets a set with the names of the attributes of the wrapped node.
      (package private) java.util.List<XMLBeanDeclaration.NodeData<T>> getChildren()
      Gets a list with the children of the wrapped node, again wrapped into NodeData objects.
      (package private) java.util.List<XMLBeanDeclaration.NodeData<T>> getChildren​(java.lang.String name)
      Gets a list with the children of the wrapped node with the given name, again wrapped into NodeData objects.
      (package private) boolean matchesConfigRootNode​(HierarchicalConfiguration<?> config)
      Returns a flag whether the wrapped node is the root node of the passed in configuration.
      (package private) java.lang.String nodeName()
      Returns the name of the wrapped node.
      (package private) java.util.List<XMLBeanDeclaration.NodeData<T>> wrapInNodeData​(java.util.List<T> nodes)
      Wraps the passed in list of nodes in NodeData objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • node

        private final T node
        The wrapped node.
      • nodeHandler

        private final NodeHandler<T> nodeHandler
        The node handler for interacting with this node.
    • Constructor Detail

      • NodeData

        NodeData​(T node,
                 NodeHandler<T> nodeHandler)
        Constructs a new instance of NodeData.
        Parameters:
        node - the node
        nodeHandler - the node handler
    • Method Detail

      • escapedNodeName

        java.lang.String escapedNodeName​(HierarchicalConfiguration<?> config)
        Returns the unescaped name of the node stored in this data object. This method handles the case that the node name may contain reserved characters with a special meaning for the current expression engine. In this case, the characters affected have to be escaped accordingly.
        Parameters:
        config - the configuration
        Returns:
        the escaped node name
      • getAttribute

        java.lang.Object getAttribute​(java.lang.String key)
        Gets the value of the attribute with the given name of the wrapped node.
        Parameters:
        key - the key of the attribute
        Returns:
        the value of this attribute
      • getAttributes

        java.util.Set<java.lang.String> getAttributes()
        Gets a set with the names of the attributes of the wrapped node.
        Returns:
        the attribute names of this node
      • getChildren

        java.util.List<XMLBeanDeclaration.NodeData<T>> getChildren()
        Gets a list with the children of the wrapped node, again wrapped into NodeData objects.
        Returns:
        a list with the children
      • getChildren

        java.util.List<XMLBeanDeclaration.NodeData<T>> getChildren​(java.lang.String name)
        Gets a list with the children of the wrapped node with the given name, again wrapped into NodeData objects.
        Parameters:
        name - the name of the desired child nodes
        Returns:
        a list with the children with this name
      • matchesConfigRootNode

        boolean matchesConfigRootNode​(HierarchicalConfiguration<?> config)
        Returns a flag whether the wrapped node is the root node of the passed in configuration.
        Parameters:
        config - the configuration
        Returns:
        a flag whether this node is the configuration's root node
      • nodeName

        java.lang.String nodeName()
        Returns the name of the wrapped node.
        Returns:
        the node name
      • wrapInNodeData

        java.util.List<XMLBeanDeclaration.NodeData<T>> wrapInNodeData​(java.util.List<T> nodes)
        Wraps the passed in list of nodes in NodeData objects.
        Parameters:
        nodes - the list with nodes
        Returns:
        the wrapped nodes