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

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

protected class PublicFieldUberspect.PublicFieldGetter
extends java.lang.Object
implements org.apache.velocity.util.introspection.VelPropertyGet

Implementation of VelPropertyGet that gets from public fields.

Version:
$Id: $
Author:
Shinobu Kawai

Constructor Summary
PublicFieldUberspect.PublicFieldGetter(java.lang.reflect.Field field)
          Constructor.
 
Method Summary
 java.lang.String getMethodName()
          Returns "public field getter", since there is no method.
 java.lang.Object invoke(java.lang.Object o)
          Returns the value of 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.PublicFieldGetter

public PublicFieldUberspect.PublicFieldGetter(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)
                        throws java.lang.Exception
Returns the value of the public field.

Specified by:
invoke in interface org.apache.velocity.util.introspection.VelPropertyGet
Parameters:
o - the object
Returns:
the value
Throws:
java.lang.Exception - failed to get the value from the object

isCacheable

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

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

getMethodName

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

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


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