|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.util.ObjectInspector
public final class ObjectInspector
This class lets you examine an object and dump its internal attributes. It was introduced to find some secrets of IBM's classloader.
| Field Summary | |
|---|---|
static String |
NOTHING_FOUND
The value for "nothing found". |
| Constructor Summary | |
|---|---|
ObjectInspector(Object obj)
Instantiates a new object inspector. |
|
| Method Summary | |
|---|---|
void |
dump(Writer writer)
Dump the inspected class. |
String |
findValue(Object value)
Find the value in of the attributes of the inspected object. |
Collection<Field> |
getAllFields()
Gets all fields of the wrapped object. |
Class<?> |
getType()
Gets the type (class) of the stored object. |
boolean |
isArrayType()
Checks if the wrapped object is an array type. |
static boolean |
isArrayType(Object obj)
Checks if the given object is an array. |
boolean |
isComplexType()
Checks if the wrapped object is complex type. |
static boolean |
isComplexType(Object obj)
Checks if the given object is of complex type. |
boolean |
isIterable()
Checks if the type of the wrapped object could be iterated. |
static boolean |
isIterable(Object obj)
Checks if the type of the given object could be iterated. |
String |
toLongString()
To long string. |
String |
toString()
Dumps all attributes of the inspected object in the form attribute=value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String NOTHING_FOUND
| Constructor Detail |
|---|
public ObjectInspector(Object obj)
obj - the object to be inspected| Method Detail |
|---|
public Class<?> getType()
public String findValue(Object value)
throws ValueNotFoundException
Pattern as parameter if you want to use wildcards for
the search.
value - the value or the pattern you want to look for
ValueNotFoundException - the value not found exceptionpublic Collection<Field> getAllFields()
public void dump(Writer writer)
throws IOException
writer - the writer
IOException - Signals that an I/O exception has occurred.public boolean isComplexType()
public static boolean isComplexType(Object obj)
obj - the obj
public boolean isArrayType()
public static boolean isArrayType(Object obj)
obj - the obj
public boolean isIterable()
public static boolean isIterable(Object obj)
obj - the object
public String toString()
attribute=value.
toString in class ObjectObject.toString()public String toLongString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||