|
|||||||||
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 ResultNode
s are maintained as a tree, each node maintains references to its parent node as
well as children nodes.
Constructor Summary | |
---|---|
ResultNode(Object result,
ResultDescriptor resultDesc)
Creates a new ResultNode object. |
|
ResultNode(Object result,
ResultDescriptor resultDesc,
List<? extends ResultNode> children)
Creates a new ResultNode object. |
|
ResultNode(Object result,
String displayNameMethodName,
String detailsMethodName,
Map<String,String> actionMethodNames,
String onRemoveMethodName)
Creates a new ResultNode object. |
|
ResultNode(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(List<? extends ResultNode> children)
Adds the List of ResultNode s as children of this node. |
List<String> |
getActionNames()
Returns a List of action display names for this result. |
List<ResultNode> |
getChildren()
Returns the List of children nodes. |
Map<String,Object> |
getDetails()
Returns the details for this result. |
String |
getDisplayName()
Returns the display name for this result. |
ResultNode |
getParent()
Returns the parent ResultNode for this node. |
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. |
Object |
onRemove()
Invokes the designated on-remove method on this result as well as its children. |
Object |
processAction(String actionName)
Invokes the action corresponding to the given actionName . |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResultNode(String stringResult)
Creates a new ResultNode
object for this String
result.
Same as:
this(stringResult, ResultDescriptor.STRING_RESULT_DESCRIPTOR, null);
stringResult
- public ResultNode(Object result, String displayNameMethodName, String detailsMethodName, Map<String,String> actionMethodNames, 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 removedpublic ResultNode(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(Object result, ResultDescriptor resultDesc, 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 result
children
- the List
of children ResultNode
s, if anyMethod Detail |
---|
public String getDisplayName()
Returns the display name for this result.
The display name is retrieved by invoking the desginated method name on the result.
public Map<String,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 List<String> getActionNames()
Returns a List
of action display names for this result.
List
of action display names for this resultpublic Object processAction(String actionName)
Invokes the action corresponding to the given actionName
.
actionName
- the name corresponding to which the action is to be invoked
public Object onRemove()
Invokes the designated on-remove method on this result as well as its children.
public void addChildren(List<? extends ResultNode> children)
Adds the List
of ResultNode
s as children of this node.
children
- a List
of ResultNode
s 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 nodepublic 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 List<ResultNode> getChildren()
Returns the List
of children nodes.
List
of children nodespublic 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 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 String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |