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

All Known Implementing Classes:
JavaDescriptorReadAccessor, JavaFieldReadAccessor, JavaMethodReadAccessor

public interface IJavaReadAccessor

IJavaReadAccessor provides read access to a Java property's value.

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

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.
 

Method Detail

getPropertyDescriptor

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

Returns:
IJavaPropertyDescriptor the property descriptor

get

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

Parameters:
obj - object from which the represented property's value is to be extracted
Returns:
Object the value of the represented property in object obj; primitive values are wrapped in an appropriate object before being returned
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).
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.

getBoolean

boolean getBoolean(java.lang.Object obj)
                   throws java.lang.IllegalArgumentException,
                          java.lang.IllegalAccessException,
                          gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Gets the value of a static or instance boolean property.

Parameters:
obj - the object to extract the boolean value from
Returns:
boolean the value of the boolean property
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 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.
See Also:
get(java.lang.Object)

getByte

byte getByte(java.lang.Object obj)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
Gets the value of a static or instance byte property.

Parameters:
obj - the object to extract the byte value from
Returns:
byte the value of the byte property
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 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.
See Also:
get(java.lang.Object)

getChar

char getChar(java.lang.Object obj)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the char value from
Returns:
char the value of the property converted to type char
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 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.
See Also:
get(java.lang.Object)

getShort

short getShort(java.lang.Object obj)
               throws java.lang.IllegalArgumentException,
                      java.lang.IllegalAccessException,
                      gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the short value from
Returns:
short the value of the property converted to type short
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 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.
See Also:
get(java.lang.Object)

getInt

int getInt(java.lang.Object obj)
           throws java.lang.IllegalArgumentException,
                  java.lang.IllegalAccessException,
                  gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the int value from
Returns:
int the value of the property converted to type int
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 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.
See Also:
get(java.lang.Object)

getLong

long getLong(java.lang.Object obj)
             throws java.lang.IllegalArgumentException,
                    java.lang.IllegalAccessException,
                    gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the long value from
Returns:
long the value of the property converted to type long
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 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.
See Also:
get(java.lang.Object)

getFloat

float getFloat(java.lang.Object obj)
               throws java.lang.IllegalArgumentException,
                      java.lang.IllegalAccessException,
                      gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the float value from
Returns:
float the value of the property converted to type float
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 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.
See Also:
get(java.lang.Object)

getDouble

double getDouble(java.lang.Object obj)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalAccessException,
                        gov.nasa.arc.brahms.common.exceptions.PropertyAccessException
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.

Parameters:
obj - the object to extract the double value from
Returns:
double the value of the property converted to type double
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 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.
See Also:
get(java.lang.Object)


Copyright © 1997-2012 All Rights Reserved.