com.googlecode.fascinator.common
Class ManifestNode

java.lang.Object
  extended by com.googlecode.fascinator.common.JsonSimple
      extended by com.googlecode.fascinator.common.ManifestNode

public class ManifestNode
extends JsonSimple

Represents a node in a JSON manifest. This object wraps the JSON interface (but does not extend it) with supplemental data to aid navigation.

Author:
Greg Pendlebury

Constructor Summary
ManifestNode()
          Create a new empty node
ManifestNode(JsonObject newJsonObject)
          Wrap a JsonObject in this class
 
Method Summary
 boolean addChild(java.lang.String id, java.lang.String title)
          Add a new child node to this node.
 java.util.List<ManifestNode> getChildren()
          Return a list of children for this node.
 boolean getHidden()
          Get the hidden flag for this node.
 java.lang.String getId()
          Get the ID for this node.
 java.lang.String getKey()
          Get the key of this node.
 java.lang.String getParentKey()
          Get the key of the parent node to this node.
 java.lang.String getTitle()
          Get the title for this node.
 boolean hasChildren()
          Check if this node has any children.
 void setHidden(boolean hidden)
          Set the hidden flag for this node.
 void setId(java.lang.String id)
          Set the ID for this node.
 void setKey(java.lang.String newKey)
          Set the key of this node.
 void setParentKey(java.lang.String newParent)
          Set the key of the parent node to this node.
 void setTitle(java.lang.String title)
          Set the title for this node.
 
Methods inherited from class com.googlecode.fascinator.common.JsonSimple
fromJavaMap, getArray, getBoolean, getInteger, getJsonArray, getJsonObject, getJsonSimpleList, getJsonSimpleMap, getObject, getPath, getString, getStringList, getStringList, getStringList, search, setPropertySubstitution, toJavaList, toJavaMap, toString, toString, writeArray, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManifestNode

public ManifestNode()
Create a new empty node


ManifestNode

public ManifestNode(JsonObject newJsonObject)
Wrap a JsonObject in this class

Parameters:
newJsonObject - : The JsonObject to wrap
Method Detail

getKey

public java.lang.String getKey()
Get the key of this node.

Returns:
String : The node key

setKey

public void setKey(java.lang.String newKey)
Set the key of this node.

Parameters:
newKey - : The new key

getParentKey

public java.lang.String getParentKey()
Get the key of the parent node to this node.

Returns:
String : The parent node key, null if this is a top level node

setParentKey

public void setParentKey(java.lang.String newParent)
Set the key of the parent node to this node.

Parameters:
newParent - : The parent node key, null if this is a top level node

addChild

public boolean addChild(java.lang.String id,
                        java.lang.String title)
Add a new child node to this node.

Parameters:
id - : The ID value to put in this node.
title - : The title value to put in this node.
Returns:
boolean : True if successful, otherwise False

hasChildren

public boolean hasChildren()
Check if this node has any children.

Returns:
boolean : True if there are children, otherwise False

getChildren

public java.util.List<ManifestNode> getChildren()
Return a list of children for this node. The list will reflect the order of the underlying manifest.

Returns:
List : List of child nodes. Will not return null, a zero length List will be returned if no children are found.

getHidden

public boolean getHidden()
Get the hidden flag for this node.

Returns:
boolean : True if hidden, False otherwise

setHidden

public void setHidden(boolean hidden)
Set the hidden flag for this node.

Parameters:
hidden - : The new flag

getId

public java.lang.String getId()
Get the ID for this node.

Returns:
String : The ID of this node

setId

public void setId(java.lang.String id)
Set the ID for this node.

Parameters:
id - : The new ID

getTitle

public java.lang.String getTitle()
Get the title for this node.

Returns:
String : The title of this node

setTitle

public void setTitle(java.lang.String title)
Set the title for this node.

Parameters:
title - : The new title


Copyright © 2009-2013. All Rights Reserved.