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

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

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

Implementation of VelPropertyGet that gets length from arrays.

Version:
$Id: $
Author:
Shinobu Kawai

Constructor Summary
PublicFieldUberspect.ArrayLengthGetter()
          Constructor.
 
Method Summary
 java.lang.String getMethodName()
          Returns "array length getter", since there is no method.
 java.lang.Object invoke(java.lang.Object o)
          Returns the length of the array.
 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.ArrayLengthGetter

public PublicFieldUberspect.ArrayLengthGetter()
Constructor.

Method Detail

invoke

public java.lang.Object invoke(java.lang.Object o)
                        throws java.lang.Exception
Returns the length of the array.

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

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 "array length getter", since there is no method.

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


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