|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.common.util.Introspector
public class Introspector
A class to allow access to the methods "fooType getFoo()" and "void setFoo(fooType)" conventionally seen in objects. Useful when Foo arrives as a run-time String, such as is the case in serialization to/from XML representations.
Constructor Summary | |
---|---|
Introspector(java.lang.Class<?> theClass,
java.lang.String field)
Build a new Introspector for the specified class and field name. |
Method Summary | |
---|---|
java.lang.String |
getter(java.lang.Object obj)
Invoke the get-method for this Introspector. |
void |
setter(java.lang.Object obj,
java.lang.String value)
Invoke the set-method provided by this Introspector. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Introspector(java.lang.Class<?> theClass, java.lang.String field) throws java.lang.IllegalArgumentException
theClass
- The Class
of interest.field
- The field name within the class of interest.
java.lang.IllegalArgumentException
Method Detail |
---|
public java.lang.String getter(java.lang.Object obj) throws java.lang.IllegalArgumentException
obj
- An Object
(really of type theClass)
whose get-method is to be invoked.
String
containing the result of invoking
the get-method.
java.lang.IllegalArgumentException
public void setter(java.lang.Object obj, java.lang.String value) throws java.lang.IllegalArgumentException
obj
- An Object
(really of type theClass)
whose set-method is to be invoked.value
- A String
containing the value to be set.
java.lang.IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |