01: package org.jasig.portal.channels.jsp.tree;
02:
03: /**
04: * Provides default resolution of domain objects for presenting in a tree. The
05: * class uses object hashCodes for the identifiers of objects and the results of
06: * toString() for label data.
07: *
08: * @author Mark Boyd
09: */
10: public class DefaultSurrogate extends BaseSurrogateImpl {
11: /**
12: * Always returns true since it can resolve any domain object using basic
13: * java language constructs for representing the objects in the tree.
14: */
15: public boolean canResolve(Object o) {
16: return true;
17: }
18:
19: /**
20: * Returns the String version of the hash code of the passed-in object.
21: */
22: public String getId(Object o) {
23: return "" + o.hashCode();
24: }
25:
26: /**
27: * Returns the results of calling toString() on the passed in object.
28: */
29: public Object getLabelData(Object o) {
30: return null;
31: }
32: }
|