org.apache.velocity.tools.generic.introspection
Class PublicFieldUberspect.PublicFieldSetter

java.lang.Object
  extended by org.apache.velocity.tools.generic.introspection.PublicFieldUberspect.PublicFieldSetter
All Implemented Interfaces:
org.apache.velocity.util.introspection.VelPropertySet
Enclosing class:
PublicFieldUberspect

protected class PublicFieldUberspect.PublicFieldSetter
extends java.lang.Object
implements org.apache.velocity.util.introspection.VelPropertySet

Implementation of VelPropertySet that sets to public fields.

Version:
$Id: $
Author:
Shinobu Kawai

Constructor Summary
PublicFieldUberspect.PublicFieldSetter(java.lang.reflect.Field field)
          Constructor.
 
Method Summary
 java.lang.String getMethodName()
          Returns "public field setter", since there is no method.
 java.lang.Object invoke(java.lang.Object o, java.lang.Object value)
          Sets the value to the public field.
 boolean isCacheable()
          This class is cacheable, so it returns true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicFieldUberspect.PublicFieldSetter

public PublicFieldUberspect.PublicFieldSetter(java.lang.reflect.Field field)
Constructor.

Parameters:
field - The Field object representing the property.
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object o,
                               java.lang.Object value)
                        throws java.lang.Exception
Sets the value to the public field.

Specified by:
invoke in interface org.apache.velocity.util.introspection.VelPropertySet
Parameters:
o - the object
value - the value to set
Returns:
always null
Throws:
java.lang.Exception - failed to set the value to the object

isCacheable

public boolean isCacheable()
This class is cacheable, so it returns true.

Specified by:
isCacheable in interface org.apache.velocity.util.introspection.VelPropertySet
Returns:
true.

getMethodName

public java.lang.String getMethodName()
Returns "public field setter", since there is no method.

Specified by:
getMethodName in interface org.apache.velocity.util.introspection.VelPropertySet
Returns:
"public field setter"


Copyright © 2002-2005 org.ieee.shinobu. All Rights Reserved.