gov.nasa.arc.brahms.common.data
Interface IJavaWriteAccessor

All Known Implementing Classes:
JavaDescriptorWriteAccessor, JavaFieldWriteAccessor, JavaMethodWriteAccessor

public interface IJavaWriteAccessor

IJavaWriteAccessor provides write access to a Java property's value.

Version:
$Revision: 1.1 $ $Date: 2009/11/23 18:28:41 $ $Author: rnado $
Author:
Ron van Hoof

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.
 

Method Detail

getPropertyDescriptor

IJavaPropertyDescriptor getPropertyDescriptor()
Returns the IJavaPropertyDescriptor for which this is a write accessor.

Returns:
IJavaPropertyDescriptor the property descriptor

set

void set(java.lang.Object obj,
         java.lang.Object value)
         throws java.lang.IllegalArgumentException,
                java.lang.IllegalAccessException,
                gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the property represented by this 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.

Parameters:
obj - the object whose property should be modified
value - the new value for the property of obj being modified
Throws:
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.

setBoolean

void setBoolean(java.lang.Object obj,
                boolean z)
                throws java.lang.IllegalArgumentException,
                       java.lang.IllegalAccessException,
                       gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a boolean on the specified object. This method is equivalent to set(obj, zObj), where zObj is a Boolean object and zObj.booleanValue() == z.

Parameters:
obj - the object whose property should be modified
z - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setByte

void setByte(java.lang.Object obj,
             byte b)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a byte on the specified object. This method is equivalent to set(obj, bObj), where bObj is a Byte object and bObj.byteValue() == b.

Parameters:
obj - the object whose property should be modified
b - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setChar

void setChar(java.lang.Object obj,
             char c)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a char on the specified object. This method is equivalent to set(obj, cObj), where cObj is a Character object and cObj.charValue() == c.

Parameters:
obj - the object whose property should be modified
c - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setShort

void setShort(java.lang.Object obj,
              short s)
              throws java.lang.IllegalArgumentException,
                     java.lang.IllegalAccessException,
                     gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a short on the specified object. This method is equivalent to set(obj, sObj), where sObj is a Short object and sObj.shortValue() == s.

Parameters:
obj - the object whose property should be modified
s - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setInt

void setInt(java.lang.Object obj,
            int i)
            throws java.lang.IllegalArgumentException,
                   java.lang.IllegalAccessException,
                   gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as an int on the specified object. This method is equivalent to set(obj, iObj), where iObj is a Integer object and iObj.intValue() == i.

Parameters:
obj - the object whose property should be modified
i - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setLong

void setLong(java.lang.Object obj,
             long l)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a long on the specified object. This method is equivalent to set(obj, lObj), where lObj is a Long object and lObj.longValue() == l.

Parameters:
obj - the object whose property should be modified
l - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setFloat

void setFloat(java.lang.Object obj,
              float f)
              throws java.lang.IllegalArgumentException,
                     java.lang.IllegalAccessException,
                     gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a float on the specified object. This method is equivalent to set(obj, fObj), where fObj is a Float object and fObj.floatValue() == f.

Parameters:
obj - the object whose property should be modified
f - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)

setDouble

void setDouble(java.lang.Object obj,
               double d)
               throws java.lang.IllegalArgumentException,
                      java.lang.IllegalAccessException,
                      gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Sets the value of a property as a double on the specified object. This method is equivalent to set(obj, dObj), where dObj is a Double object and dObj.doubleValue() == d.

Parameters:
obj - the object whose property should be modified
d - the new value for the property of obj being modified
Throws:
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.
See Also:
set(java.lang.Object, java.lang.Object)


Copyright © 1997-2012 All Rights Reserved.