cz.cuni.pogamut.introspection.java
Class JavaProperty

java.lang.Object
  extended by cz.cuni.pogamut.introspection.java.JavaProperty
All Implemented Interfaces:
Property

public class JavaProperty
extends java.lang.Object
implements Property

Wrapps JavaReflection way of manipulating with fields of objects.


Field Summary
protected  java.lang.reflect.Field field
          Field to be changed.
protected  java.lang.Object object
          Object where is the field.
 
Constructor Summary
JavaProperty(java.lang.Object object, java.lang.reflect.Field field)
          Creates a new instance of JavaProperty
 
Method Summary
 java.lang.String getName()
           
 java.lang.Class getType()
           
 java.lang.Object getValue()
          Get value of property.
 void setValue(java.lang.Object newValue)
          Set value of property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

protected java.lang.reflect.Field field
Field to be changed.


object

protected java.lang.Object object
Object where is the field.

Constructor Detail

JavaProperty

public JavaProperty(java.lang.Object object,
                    java.lang.reflect.Field field)
Creates a new instance of JavaProperty

Parameters:
field - Field that is represented by this property
object - Object at which the new value will be set.
Method Detail

getValue

public java.lang.Object getValue()
                          throws java.lang.IllegalAccessException
Description copied from interface: Property
Get value of property.

Specified by:
getValue in interface Property
Returns:
Value of property
Throws:
java.lang.IllegalAccessException

setValue

public void setValue(java.lang.Object newValue)
              throws java.lang.IllegalAccessException
Description copied from interface: Property
Set value of property.

Specified by:
setValue in interface Property
Throws:
java.lang.IllegalAccessException

getName

public java.lang.String getName()
Specified by:
getName in interface Property
Returns:
Name of this property.

getType

public java.lang.Class getType()
Specified by:
getType in interface Property
Returns:
Type of this property.