|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bluej.extensions.BField
public class BField
A wrapper for a field of a BlueJ class. Behaviour is similar to the Reflection API.
Method Summary | |
---|---|
java.lang.reflect.Field |
getJavaField()
Returns the java Field for inspection. |
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)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
@Deprecated public boolean matches(java.lang.String fieldName)
This method is deprecated. Use "getName().equals(fieldName)" instead.
fieldName
- the field name to compare with
public java.lang.String getName()
public java.lang.Class<?> getType()
public java.lang.reflect.Field getJavaField()
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.
onThis
- Description of the Parameter
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 |