|
||||||||||
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.JavaMethodWriteAccessor
public class JavaMethodWriteAccessor
JavaMethodWriteAccessor provides write access for a property's value through a method.
Constructor Summary | |
---|---|
JavaMethodWriteAccessor(java.lang.reflect.Method method,
IJavaPropertyDescriptor property)
Constructor, creates JavaMethodWriteAccessor that writes the property value for the specified property using the specified Method. |
Method Summary | |
---|---|
IJavaPropertyDescriptor |
getPropertyDescriptor()
Returns the IJavaPropertyDescriptor for which this is a write accessor. |
void |
set(java.lang.Object obj,
java.lang.Object value)
Sets the property represented by this IJavaWriteAccessor object on the
specified object argument to the specified new value. |
void |
setBoolean(java.lang.Object obj,
boolean z)
Sets the value of a property as a boolean on the specified object. |
void |
setByte(java.lang.Object obj,
byte b)
Sets the value of a property as a byte on the specified object. |
void |
setChar(java.lang.Object obj,
char c)
Sets the value of a property as a char on the specified object. |
void |
setDouble(java.lang.Object obj,
double d)
Sets the value of a property as a double on the specified object. |
void |
setFloat(java.lang.Object obj,
float f)
Sets the value of a property as a float on the specified object. |
void |
setInt(java.lang.Object obj,
int i)
Sets the value of a property as an int on the specified object. |
void |
setLong(java.lang.Object obj,
long l)
Sets the value of a property as a long on the specified object. |
void |
setShort(java.lang.Object obj,
short s)
Sets the value of a property as a short on the specified object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaMethodWriteAccessor(java.lang.reflect.Method method, IJavaPropertyDescriptor property)
method
- the Method used to write the property valueproperty
- the IJavaPropertyDescriptor for the propertyMethod Detail |
---|
public IJavaPropertyDescriptor getPropertyDescriptor()
getPropertyDescriptor
in interface IJavaWriteAccessor
public void set(java.lang.Object obj, java.lang.Object value) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
IJavaWriteAccessor
object on the
specified object argument to the specified new value. The new
value is automatically unwrapped if the underlying property has a
primitive type.
The operation proceeds as follows:
If the underlying property is static, the obj
argument is
ignored; it may be null.
Otherwise the underlying property is an instance property. If the
specified object argument is null, the method throws a
NullPointerException
. If the specified object argument is not
an instance of the class or interface declaring the underlying
property, the method throws an IllegalArgumentException
.
If the underlying property is of a primitive type, an unwrapping
conversion is attempted to convert the new value to a value of
a primitive type. If this attempt fails, the method throws an
IllegalArgumentException
.
If, after possible unwrapping, the new value cannot be
converted to the type of the underlying property by an identity or
widening conversion, the method throws an
IllegalArgumentException
.
The property is set to the possibly unwrapped and widened new value.
set
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedvalue
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.public void setBoolean(java.lang.Object obj, boolean z) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
boolean
on the specified object.
This method is equivalent to
set(obj, zObj)
,
where zObj
is a Boolean
object and
zObj.booleanValue() == z
.
setBoolean
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedz
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setByte(java.lang.Object obj, byte b) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
byte
on the specified object.
This method is equivalent to
set(obj, bObj)
,
where bObj
is a Byte
object and
bObj.byteValue() == b
.
setByte
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedb
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setChar(java.lang.Object obj, char c) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
char
on the specified object.
This method is equivalent to
set(obj, cObj)
,
where cObj
is a Character
object and
cObj.charValue() == c
.
setChar
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedc
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setShort(java.lang.Object obj, short s) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
short
on the specified object.
This method is equivalent to
set(obj, sObj)
,
where sObj
is a Short
object and
sObj.shortValue() == s
.
setShort
in interface IJavaWriteAccessor
obj
- the object whose property should be modifieds
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setInt(java.lang.Object obj, int i) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
int
on the specified object.
This method is equivalent to
set(obj, iObj)
,
where iObj
is a Integer
object and
iObj.intValue() == i
.
setInt
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedi
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setLong(java.lang.Object obj, long l) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
long
on the specified object.
This method is equivalent to
set(obj, lObj)
,
where lObj
is a Long
object and
lObj.longValue() == l
.
setLong
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedl
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setFloat(java.lang.Object obj, float f) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
float
on the specified object.
This method is equivalent to
set(obj, fObj)
,
where fObj
is a Float
object and
fObj.floatValue() == f
.
setFloat
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedf
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
public void setDouble(java.lang.Object obj, double d) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
double
on the specified object.
This method is equivalent to
set(obj, dObj)
,
where dObj
is a Double
object and
dObj.doubleValue() == d
.
setDouble
in interface IJavaWriteAccessor
obj
- the object whose property should be modifiedd
- the new value for the property of obj
being modified
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 an unwrapping conversion fails.
gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
- if there was a problem writing/setting
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.IJavaWriteAccessor.set(java.lang.Object, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |