org.cubeengine.converter.node
Class ContainerNode<V>

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<V>
Direct Known Subclasses:
ListNode, MapNode

public abstract class ContainerNode<V>
extends Node<V>

A Node that can be a parent of another Node


Constructor Summary
ContainerNode()
           
 
Method Summary
 String asText()
          Tries to convert the value of the Node into a string
abstract  void cleanUpEmptyNodes()
          Searches for ParentNodes that do not contain data and deletes them
 Node get(Path path)
          Gets the Node for given path or null if not found
abstract  Node get(String key)
          Returns the Node for given direct key (without pathseparators).
abstract  boolean isEmpty()
          Returns whether this Node contains data
 Node remove(Path path)
          Removes the Node for given path
protected abstract  Node remove(String key)
          Removes the Node for given direct key (without pathseparators).
 Node set(Path path, Node node)
          Sets this Node for given path
abstract  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.Node
asString, getValue, 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

ContainerNode

public ContainerNode()
Method Detail

set

public Node set(Path path,
                Node node)
Sets this Node for given path

Parameters:
path - the path
node - Node to set
Returns:
the previously mapped Node
Throws:
IllegalArgumentException - when the given path is not valid e.g. because a node on the path is not a ContainerNode

get

public Node get(Path path)
Gets the Node for given path or null if not found

Parameters:
path - the path
Returns:
the Node at given path
Throws:
IllegalArgumentException - when the given path is not valid e.g. because a node on the path is not a ContainerNode

remove

public Node remove(Path path)
Removes the Node for given path

Parameters:
path - the path
Returns:
the previously mapped Node or null if not set

set

public abstract Node set(String key,
                         Node node)
Sets this Node for given key

The key will be lowercased!

Parameters:
key - the key
node - the Node to set
Returns:
the previously mapped Node or null if not set

get

public abstract Node get(String key)
Returns the Node for given direct key (without pathseparators).

The key will be lowercased!

Parameters:
key - the key
Returns:
the matched Node or null

remove

protected abstract Node remove(String key)
Removes the Node for given direct key (without pathseparators).

The key will be lowercased!

Parameters:
key - the key
Returns:
the previously mapped Node or null if not set

cleanUpEmptyNodes

public abstract void cleanUpEmptyNodes()
Searches for ParentNodes that do not contain data and deletes them


isEmpty

public abstract boolean isEmpty()
Returns whether this Node contains data

Returns:
true if this Node contains no data

asText

public String asText()
Description copied from class: Node
Tries to convert the value of the Node into a string

Specified by:
asText in class Node<V>
Returns:
the converted Node value


Copyright © 2013–2017. All rights reserved.