Esri Geoportal Server
1.0

com.esri.gpt.control.search.browse
Class TocTree

java.lang.Object
  extended by com.esri.gpt.control.search.browse.TocTree

public class TocTree
extends Object

Represents a table of contents tree.


Constructor Summary
TocTree()
          Default constructor
 
Method Summary
 String asJson()
          Returns a JSON representation of the property.
 String asXml()
          Returns an XML representation of the property.
static TocTree build(TocContext context, String relativePath)
          Builds a tree.
 String generateResponse(TocContext context)
          Generates the response string.
 List<TocItem> getChildren()
          Gets the children.
 String getIDProperty()
          Gets the ID property.
 String getLabelProperty()
          Gets the label property.
 boolean hasChildren()
          Determines whether or not this property has children.
static TocTree makeTreeInstance(TocContext context, String className)
          Makes a TocTree instance based upon a class name.
 void processTreeNode(TocContext context, Node node)
          Processes a TOC tree node.
 void setChildren(List<TocItem> children)
          Sets the children.
 void setIDProperty(String attribute)
          Sets the ID property.
 void setLabelProperty(String attribute)
          Sets the label property.
 void toJson(PrintWriter writer, int depth, boolean isLast)
          Writes a JSON representation of the property.
 void toXml(PrintWriter writer, int depth)
          Writes an XML representation of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TocTree

public TocTree()
Default constructor

Method Detail

getChildren

public List<TocItem> getChildren()
Gets the children.

Returns:
the children

setChildren

public void setChildren(List<TocItem> children)
Sets the children.

Parameters:
children - the children

getIDProperty

public String getIDProperty()
Gets the ID property.

Returns:
the ID property

setIDProperty

public void setIDProperty(String attribute)
Sets the ID property.

Parameters:
attribute - the ID property

getLabelProperty

public String getLabelProperty()
Gets the label property.

Returns:
the label property

setLabelProperty

public void setLabelProperty(String attribute)
Sets the label property.

Parameters:
attribute - the label property

asJson

public String asJson()
              throws IOException
Returns a JSON representation of the property.

Returns:
the JSON string
Throws:
IOException - if an exception occurs

asXml

public String asXml()
             throws IOException
Returns an XML representation of the property.

Returns:
the XML string
Throws:
IOException - if an exception occurs

build

public static TocTree build(TocContext context,
                            String relativePath)
                     throws Exception
Builds a tree.

Parameters:
context - the operation context
relativePath - path the associated XML document
Returns:
the tree
Throws:
Exception

generateResponse

public String generateResponse(TocContext context)
                        throws Exception
Generates the response string.

Parameters:
context - the operation context
Returns:
the response string
Throws:
Exception - if an exception occurs

hasChildren

public boolean hasChildren()
Determines whether or not this property has children.

Returns:
true if this property has children

makeTreeInstance

public static TocTree makeTreeInstance(TocContext context,
                                       String className)
                                throws ClassNotFoundException,
                                       InstantiationException,
                                       IllegalAccessException
Makes a TocTree instance based upon a class name.

Parameters:
context - the operation context
className - the fully qualified class name
Returns:
the instance
Throws:
ClassNotFoundException - if the class was not found
InstantiationException - if the class could not be instantiated
IllegalAccessException - if the class could not be accessed

processTreeNode

public void processTreeNode(TocContext context,
                            Node node)
                     throws Exception
Processes a TOC tree node.

Parameters:
context - the operation context
node - the tree node
Throws:
Exception - if an exception occurs

toJson

public void toJson(PrintWriter writer,
                   int depth,
                   boolean isLast)
            throws IOException
Writes a JSON representation of the property.

Parameters:
writer - the writer
depth - the depth of the parent
Throws:
IOException - if an exception occurs

toXml

public void toXml(PrintWriter writer,
                  int depth)
           throws IOException
Writes an XML representation of the property.

Parameters:
writer - the writer
depth - the depth of the parent
Throws:
IOException - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.