|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbluej.extensions.BField
A wrapper for a field of a BlueJ class. Behaviour is similar to the Reflection API.
| Method Summary | |
int |
getModifiers()
Returns the modifiers of this field. |
java.lang.String |
getName()
Return the name of the field. |
java.lang.Class |
getType()
Return the type of the field. |
java.lang.Object |
getValue(BObject onThis)
Return the value of this field of the given object. |
boolean |
matches(java.lang.String fieldName)
Check to see if the field name matches the given one. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean matches(java.lang.String fieldName)
public java.lang.String getName()
public java.lang.Class getType()
public int getModifiers()
java.lang.reflect.Modifier class can be used to decode the modifiers.
Similar to reflection API
public java.lang.Object getValue(BObject onThis)
throws ProjectNotOpenException,
PackageNotFoundException
int etc.),
the return value is of the appropriate Java wrapper type (Integer etc.).
In the case that the field contains an object then
an appropriate BObject will be returned.
The main reason that this method is on a field (derived from a class),
rather than directly on an object, is to allow for the retrieval of
static field values without having to create an object of the appropriate type.
As in the Relection API, in order to get the value of a static field pass
null as the parameter to this method.
ProjectNotOpenException - if the project to which the field belongs has been closed by the user.
PackageNotFoundException - if the package to which the field belongs has been deleted by the user.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||