|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.adf.web.data.results.ResultNode
public class ResultNode
The ResultNode object wraps the actual result objects that are added to the WebResults.
The ResultNode is the one which actually invokes the appropriate methods on the actual results to
retrieve the 4 pieces of information expected of a result (display text, details, actions and on-remove).
The ResultNode maintains the metadata for the result in a ResultDescriptor. This metadata
includes the methods for the display text, details, actions and on-remove.
Since the ResultNodes are maintained as a tree, each node maintains references to its parent node as
well as children nodes.
| Constructor Summary | |
|---|---|
ResultNode(java.lang.Object result,
ResultDescriptor resultDesc)
Creates a new ResultNode object. |
|
ResultNode(java.lang.Object result,
ResultDescriptor resultDesc,
java.util.List<? extends ResultNode> children)
Creates a new ResultNode object. |
|
ResultNode(java.lang.Object result,
java.lang.String displayNameMethodName,
java.lang.String detailsMethodName,
java.util.Map<java.lang.String,java.lang.String> actionMethodNames,
java.lang.String onRemoveMethodName)
Creates a new ResultNode object. |
|
ResultNode(java.lang.String stringResult)
Creates a new ResultNode object for this String result. |
|
| Method Summary | |
|---|---|
void |
addChild(int index,
ResultNode child)
Adds this ResultNode as a child of this node at the given index. |
void |
addChild(ResultNode child)
Adds this ResultNode as a child of this node. |
void |
addChildren(java.util.List<? extends ResultNode> children)
Adds the List of ResultNodes as children of this node. |
java.util.List<java.lang.String> |
getActionNames()
Returns a List of action display names for this result. |
java.util.List<ResultNode> |
getChildren()
Returns the List of children nodes. |
java.util.Map<java.lang.String,java.lang.Object> |
getDetails()
Returns the details for this result. |
java.lang.String |
getDisplayName()
Returns the display name for this result. |
ResultNode |
getParent()
Returns the parent ResultNode for this node. |
java.lang.Object |
getResult()
Returns the actual result object wrapped by this ResultNode object. |
ResultDescriptor |
getTaskResultDescriptor()
Returns the ResultDescriptor associated with this result. |
boolean |
isHasDetails()
Returns true if a details method was designated for this result. |
java.lang.Object |
onRemove()
Invokes the designated on-remove method on this result as well as its children. |
java.lang.Object |
processAction(java.lang.String actionName)
Invokes the action corresponding to the given actionName. |
java.lang.String |
recursiveToString(int indent)
A convenience method to recursively iterate through and return the contents of the children nodes as a String. |
void |
setTaskResultDescriptor(ResultDescriptor resultDesc)
Sets the ResultDescriptor to be associated with this result. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResultNode(java.lang.String stringResult)
Creates a new ResultNode object for this String result.
Same as:
this(stringResult, ResultDescriptor.STRING_RESULT_DESCRIPTOR, null);
stringResult -
public ResultNode(java.lang.Object result,
java.lang.String displayNameMethodName,
java.lang.String detailsMethodName,
java.util.Map<java.lang.String,java.lang.String> actionMethodNames,
java.lang.String onRemoveMethodName)
Creates a new ResultNode object.
The ResultDescriptor representing the metadata for this result is created by using the various method names
provided as arguments to this constructor.
result - the result to be wrapped by this nodedisplayNameMethodName - the name of the method which returns the display text for the resultdetailsMethodName - the name of the method which returns the result details as a java.util.Map
of name-value pairsactionMethodNames - an array of names of methods for performing actions on the resultonRemoveMethodName - the name of the method to be called when the result is removed
public ResultNode(java.lang.Object result,
ResultDescriptor resultDesc)
Creates a new ResultNode object.
The newly created node wraps the given result. The metadata for the result is included in the
resultDesc.
Same as:
this(result, resultDesc, null);
result - the result to be wrapped by this noderesultDesc - the ResultDescriptor representing the metadata for this result
public ResultNode(java.lang.Object result,
ResultDescriptor resultDesc,
java.util.List<? extends ResultNode> children)
Creates a new ResultNode object.
The newly created node wraps the given result. The metadata for the result is included in the
resultDesc. Optionally, one can also provide a List of children nodes, if any.
result - the result to be wrapped by this noderesultDesc - the ResultDescriptor representing the metadata for this resultchildren - the List of children ResultNodes, if any| Method Detail |
|---|
public java.lang.String getDisplayName()
Returns the display name for this result.
The display name is retrieved by invoking the desginated method name on the result.
public java.util.Map<java.lang.String,java.lang.Object> getDetails()
Returns the details for this result. The details are represented as a java.util.Map of name-value
pairs.
The details are retrieved by invoking the desginated method name on the result.
java.util.Map of name-value pairspublic boolean isHasDetails()
Returns true if a details method was designated for this result.
public java.util.List<java.lang.String> getActionNames()
Returns a List of action display names for this result.
List of action display names for this resultpublic java.lang.Object processAction(java.lang.String actionName)
Invokes the action corresponding to the given actionName.
actionName - the name corresponding to which the action is to be invoked
public java.lang.Object onRemove()
Invokes the designated on-remove method on this result as well as its children.
public void addChildren(java.util.List<? extends ResultNode> children)
Adds the List of ResultNodes as children of this node.
children - a List of ResultNodes to be added as children of this nodepublic void addChild(ResultNode child)
Adds this ResultNode as a child of this node.
child - the ResultNode to be added as a child of this node
public void addChild(int index,
ResultNode child)
Adds this ResultNode as a child of this node at the given index.
If the index is invalid, then the child is added as the last child of this node.
index - the index at which the child is to be addedchild - the ResultNode to be added as a child of this nodepublic java.util.List<ResultNode> getChildren()
Returns the List of children nodes.
List of children nodespublic java.lang.Object getResult()
Returns the actual result object wrapped by this ResultNode object.
Object wrapped by this ResultNode objectpublic ResultDescriptor getTaskResultDescriptor()
Returns the ResultDescriptor associated with this result.
ResultDescriptor associated with this resultpublic void setTaskResultDescriptor(ResultDescriptor resultDesc)
Sets the ResultDescriptor to be associated with this result.
resultDesc - the ResultDescriptor to be associated with this resultpublic ResultNode getParent()
Returns the parent ResultNode for this node.
ResultNode for this nodepublic java.lang.String recursiveToString(int indent)
A convenience method to recursively iterate through and return the contents of the children nodes as a
String.
indent - number of whitespaces
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||