|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.jcosyne.client.Introspective
A collection of static utility functions for turning objects into textual representation.
Constructor Summary | |
Introspective()
|
Method Summary | |
static java.lang.String |
createReport(java.lang.Object value)
Turns an object into a string. |
static java.lang.String |
extractAttributeName(java.lang.String s)
Given a string of the form "A@B" extract "B". |
static java.lang.String[] |
extractSpec(java.lang.String s)
Extract a list of names separated by "@" character in string s. |
static java.lang.Object |
extractValue(java.lang.Object holder,
java.lang.String[] spec)
Given a Java object and a list of names, try to recursively extract the instance refered to by the names. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Introspective()
Method Detail |
public static java.lang.Object extractValue(java.lang.Object holder, java.lang.String[] spec)
holder
and passing { "5", "C" } as the list of names, will extract the desired object. Currently
works for arrays of whatever dimension and class fields.
holder
- the object instance that contains the instance that we want to extractspec
- array of names, that are resolved one-by-one on the holder
public static java.lang.String createReport(java.lang.Object value)
value
- object for which to create a report
public static java.lang.String extractAttributeName(java.lang.String s)
s
- the concatenated string
public static java.lang.String[] extractSpec(java.lang.String s)
s
- string to parse
extractValue()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |