FileDocCategorySizeDatePackage
FieldBeanProperty.javaAPI DocJBoss 4.2.12518Fri Jul 13 20:53:46 BST 2007org.jboss.injection.lang.reflect

FieldBeanProperty

public class FieldBeanProperty extends AbstractAccessibleObjectBeanProperty
Morphes a field into a bean property.
author
Carlo de Wolf
version
$Revision: $

Fields Summary
private static final Logger
log
Constructors Summary
public FieldBeanProperty(Field field)

param
field

   
         
     
   
      super(field);
   
Methods Summary
public java.lang.ClassgetDeclaringClass()

      return getField().getDeclaringClass();
   
protected java.lang.reflect.FieldgetField()

      return getAccessibleObject();
   
public java.lang.StringgetName()

      return getField().getName();
   
public java.lang.ClassgetType()

      return getField().getType();
   
public voidset(java.lang.Object instance, java.lang.Object value)

      Field field = getField();
      try
      {
         field.set(instance, value);
      }
      catch(IllegalAccessException e)
      {
         log.fatal("illegal access on field " + field, e);
         throw new RuntimeException(e);
      }
      catch(IllegalArgumentException e)
      {
         String msg = "failed to set value " + value + " on field " + field;
         log.error(msg, e);
         throw new IllegalArgumentException(msg);
      }