org.cubeengine.converter.node
Class ListNode

java.lang.Object
  extended by org.cubeengine.converter.node.Commentable
      extended by org.cubeengine.converter.node.Node<V>
          extended by org.cubeengine.converter.node.ContainerNode
              extended by org.cubeengine.converter.node.ListNode

public class ListNode
extends ContainerNode

A List Node

It can contain a list of other Nodes


Constructor Summary
ListNode()
           
 
Method Summary
 void addNode(Node node)
          Adds a node to the list
 String asString()
           
 void cleanUpEmptyNodes()
          Searches for ParentNodes that do not contain data and deletes them
static ListNode emptyList()
          Creates an Empty ListNode
 Node get(String key)
          Returns the Node for given direct key (without pathseparators).
 List<Node> getValue()
          Gets the Value contained in this Node
 boolean isEmpty()
          Returns whether this Node contains data
protected  Node remove(String key)
          Removes the Node for given direct key (without pathseparators).
 Node set(String key, Node node)
          Sets this Node for given key The key will be lowercased!
 
Methods inherited from class org.cubeengine.converter.node.ContainerNode
asText, get, remove, set
 
Methods inherited from class org.cubeengine.converter.node.Node
isInherited, setInherited
 
Methods inherited from class org.cubeengine.converter.node.Commentable
getComments, setComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListNode

public ListNode()
Method Detail

emptyList

public static ListNode emptyList()
Creates an Empty ListNode

Returns:
the empty listnode

getValue

public List<Node> getValue()
Description copied from class: Node
Gets the Value contained in this Node

Specified by:
getValue in class Node
Returns:
the NodeValue

addNode

public void addNode(Node node)
Adds a node to the list

Parameters:
node - the node to add

set

public Node set(String key,
                Node node)
Description copied from class: ContainerNode
Sets this Node for given key

The key will be lowercased!

Specified by:
set in class ContainerNode
Parameters:
key - the key
node - the Node to set
Returns:
the previously mapped Node or null if not set

get

public Node get(String key)
Description copied from class: ContainerNode
Returns the Node for given direct key (without pathseparators).

The key will be lowercased!

Specified by:
get in class ContainerNode
Parameters:
key - the key
Returns:
the matched Node or null

remove

protected Node remove(String key)
Description copied from class: ContainerNode
Removes the Node for given direct key (without pathseparators).

The key will be lowercased!

Specified by:
remove in class ContainerNode
Parameters:
key - the key
Returns:
the previously mapped Node or null if not set

isEmpty

public boolean isEmpty()
Description copied from class: ContainerNode
Returns whether this Node contains data

Specified by:
isEmpty in class ContainerNode
Returns:
true if this Node contains no data

cleanUpEmptyNodes

public void cleanUpEmptyNodes()
Description copied from class: ContainerNode
Searches for ParentNodes that do not contain data and deletes them

Specified by:
cleanUpEmptyNodes in class ContainerNode

asString

public String asString()
Specified by:
asString in class Node


Copyright © 2013–2017. All rights reserved.