|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.data.JavaFieldReadAccessor
public class JavaFieldReadAccessor
JavaFieldReadAccessor provides read access for a property's value through a field.
Constructor Summary | |
---|---|
JavaFieldReadAccessor(java.lang.reflect.Field field,
IJavaPropertyDescriptor property)
Constructor, creates JavaFieldReadAccessor that reads the property value for the specified property from the specified Field. |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.Object obj)
Returns the value of the property represented by the IJavaPropertyDescriptor , on the specified object. |
boolean |
getBoolean(java.lang.Object obj)
Gets the value of a static or instance boolean property. |
byte |
getByte(java.lang.Object obj)
Gets the value of a static or instance byte property. |
char |
getChar(java.lang.Object obj)
Gets the value of a static or instance property of type char or of another primitive type convertible to
type char via a widening conversion. |
double |
getDouble(java.lang.Object obj)
Gets the value of a static or instance property of type double or of another primitive type convertible to
type double via a widening conversion. |
float |
getFloat(java.lang.Object obj)
Gets the value of a static or instance property of type float or of another primitive type convertible to
type float via a widening conversion. |
int |
getInt(java.lang.Object obj)
Gets the value of a static or instance property of type int or of another primitive type convertible to
type int via a widening conversion. |
long |
getLong(java.lang.Object obj)
Gets the value of a static or instance property of type long or of another primitive type convertible to
type long via a widening conversion. |
IJavaPropertyDescriptor |
getPropertyDescriptor()
Returns the IJavaPropertyDescriptor for which this is a read accessor. |
short |
getShort(java.lang.Object obj)
Gets the value of a static or instance property of type short or of another primitive type convertible to
type short via a widening conversion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaFieldReadAccessor(java.lang.reflect.Field field, IJavaPropertyDescriptor property)
field
- the Field from which to read the property valueproperty
- the IJavaPropertyDescriptor for the propertyMethod Detail |
---|
public IJavaPropertyDescriptor getPropertyDescriptor()
getPropertyDescriptor
in interface IJavaReadAccessor
public java.lang.Object get(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
IJavaPropertyDescriptor
, on the specified object.
The value is automatically wrapped in an object if it has a
primitive type.
The underlying property's value is obtained as follows:
If the underlying property is a static property, the obj
argument is ignored; it may be null.
Otherwise, the underlying property is an member property. If the
specified obj
argument is null, the method throws a
NullPointerException.
If the specified object is not an
instance of the class or interface declaring the underlying
property, the method throws an IllegalArgumentException
.
Otherwise, the value is retrieved from the underlying instance or static property. If the property has a primitive type, the value is wrapped in an object before being returned, otherwise it is returned as is.
get
in interface IJavaReadAccessor
obj
- object from which the represented property's value is
to be extracted
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not an
instance of the class or interface declaring the underlying
property (or a subclass or implementor thereof).
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is a member property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.public boolean getBoolean(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
boolean
property.
getBoolean
in interface IJavaReadAccessor
obj
- the object to extract the boolean
value from
boolean
property
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type boolean
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is a member property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public byte getByte(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
byte
property.
getByte
in interface IJavaReadAccessor
obj
- the object to extract the byte
value from
byte
property
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type byte
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public char getChar(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
char
or of another primitive type convertible to
type char
via a widening conversion.
getChar
in interface IJavaReadAccessor
obj
- the object to extract the char
value from
char
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type char
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public short getShort(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
short
or of another primitive type convertible to
type short
via a widening conversion.
getShort
in interface IJavaReadAccessor
obj
- the object to extract the short
value from
short
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type short
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public int getInt(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
int
or of another primitive type convertible to
type int
via a widening conversion.
getInt
in interface IJavaReadAccessor
obj
- the object to extract the int
value from
int
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type int
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public long getLong(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
long
or of another primitive type convertible to
type long
via a widening conversion.
getLong
in interface IJavaReadAccessor
obj
- the object to extract the long
value from
long
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type long
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public float getFloat(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
float
or of another primitive type convertible to
type float
via a widening conversion.
getFloat
in interface IJavaReadAccessor
obj
- the object to extract the float
value
from
float
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type float
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
public double getDouble(java.lang.Object obj) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
double
or of another primitive type convertible to
type double
via a widening conversion.
getDouble
in interface IJavaReadAccessor
obj
- the object to extract the double
value from
double
java.lang.IllegalAccessException
- if the underlying property
is inaccessible.
java.lang.IllegalArgumentException
- if the specified object is not
an instance of the class or interface declaring the
underlying property (or a subclass or implementor
thereof), or if the property value cannot be
converted to the type double
by a
widening conversion.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem reading
the property's value
java.lang.NullPointerException
- if the specified object is null
and the property is an instance property.
java.lang.ExceptionInInitializerError
- if the initialization provoked
by this method fails.IJavaReadAccessor.get(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |