Class ClassTool.MethodSub
- java.lang.Object
-
- org.apache.velocity.tools.generic.ClassTool.Sub<T>
-
- org.apache.velocity.tools.generic.ClassTool.CallableSub<ClassTool.MethodSub>
-
- org.apache.velocity.tools.generic.ClassTool.MethodSub
-
- All Implemented Interfaces:
java.lang.Comparable<ClassTool.MethodSub>
- Enclosing class:
- ClassTool
public static class ClassTool.MethodSub extends ClassTool.CallableSub<ClassTool.MethodSub>
A simplified wrapping interface for inspecting features of aMethodin an inspected Class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.Methodmethod-
Fields inherited from class org.apache.velocity.tools.generic.ClassTool.CallableSub
javadocRef, signature, uniqueName
-
-
Constructor Summary
Constructors Constructor Description MethodSub(java.lang.reflect.Method method)Method inspector constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.reflect.AnnotatedElementgetElement()protected intgetModifiers()java.lang.StringgetName()java.lang.Class[]getParameters()java.lang.StringgetPropertyName()If this method can be treated as a bean property in Velocity (which does not exactly follow the javabean spec for such things) then it will return the "bean property" equivalent of the method name.java.lang.ClassgetReturns()protected java.lang.StringgetSubType()booleanisVarArgs()Returns true if the final parameter for the method was declared as a vararg.booleanisVoid()Returns true if the return type of this method is void.-
Methods inherited from class org.apache.velocity.tools.generic.ClassTool.CallableSub
getJavadocRef, getParameterCount, getSignature, getUniqueName, signature, takesParameters
-
Methods inherited from class org.apache.velocity.tools.generic.ClassTool.Sub
compareTo, equals, getAnnotations, hashCode, isAbstract, isDeprecated, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, toString
-
-
-
-
Method Detail
-
getElement
protected java.lang.reflect.AnnotatedElement getElement()
- Specified by:
getElementin classClassTool.Sub<ClassTool.MethodSub>- Returns:
- inspected element
-
getName
public java.lang.String getName()
- Specified by:
getNamein classClassTool.Sub<ClassTool.MethodSub>- Returns:
- method name
-
getPropertyName
public java.lang.String getPropertyName()
If this method can be treated as a bean property in Velocity (which does not exactly follow the javabean spec for such things) then it will return the "bean property" equivalent of the method name. (e.g. for getFoo(), isFoo() or setFoo(foo) it will return "foo")- Returns:
- related property name, or null
-
isVarArgs
public boolean isVarArgs()
Returns true if the final parameter for the method was declared as a vararg.- Specified by:
isVarArgsin classClassTool.CallableSub<ClassTool.MethodSub>- Returns:
- vararg status
-
isVoid
public boolean isVoid()
Returns true if the return type of this method is void.- Returns:
trueif the inspected method returns null
-
getReturns
public java.lang.Class getReturns()
- Returns:
- inspected method return type
-
getParameters
public java.lang.Class[] getParameters()
- Specified by:
getParametersin classClassTool.CallableSub<ClassTool.MethodSub>- Returns:
- inspected method parameters types
-
getModifiers
protected int getModifiers()
- Specified by:
getModifiersin classClassTool.Sub<ClassTool.MethodSub>- Returns:
- inspected method modifiers
-
getSubType
protected java.lang.String getSubType()
- Specified by:
getSubTypein classClassTool.Sub<ClassTool.MethodSub>- Returns:
- inspector type, aka "method"
-
-