Class ClassTool.CallableSub<T extends ClassTool.CallableSub>
- java.lang.Object
-
- org.apache.velocity.tools.generic.ClassTool.Sub<T>
-
- org.apache.velocity.tools.generic.ClassTool.CallableSub<T>
-
- All Implemented Interfaces:
java.lang.Comparable<T>
- Direct Known Subclasses:
ClassTool.ConstructorSub,ClassTool.MethodSub
- Enclosing class:
- ClassTool
public abstract static class ClassTool.CallableSub<T extends ClassTool.CallableSub> extends ClassTool.Sub<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringjavadocRefprotected java.lang.Stringsignatureprotected java.lang.StringuniqueName
-
Constructor Summary
Constructors Constructor Description CallableSub()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetJavadocRef()intgetParameterCount()Returns the number of expected parameters.abstract java.lang.Class[]getParameters()java.lang.StringgetSignature()Get (and cache) inspected callable signaturejava.lang.StringgetUniqueName()Build a unique method/ctor name by appending the simple names of the expected parameter types, thereby distinguishing constructors and overloaded methods with a useful name that would still be a valid method name.abstract booleanisVarArgs()protected java.lang.Stringsignature(boolean fullNames)Internal method to get the inspected callable signature.booleantakesParameters()-
Methods inherited from class org.apache.velocity.tools.generic.ClassTool.Sub
compareTo, equals, getAnnotations, getElement, getModifiers, getName, getSubType, hashCode, isAbstract, isDeprecated, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, toString
-
-
-
-
Method Detail
-
getParameters
public abstract java.lang.Class[] getParameters()
-
isVarArgs
public abstract boolean isVarArgs()
-
takesParameters
public boolean takesParameters()
- Returns:
- whether the inspected callable takes parameters
-
getParameterCount
public int getParameterCount()
Returns the number of expected parameters. If this method or constructor is declared with varargs, the vararg only counts as one.- Returns:
- inspected callable parameters count
-
getUniqueName
public java.lang.String getUniqueName()
Build a unique method/ctor name by appending the simple names of the expected parameter types, thereby distinguishing constructors and overloaded methods with a useful name that would still be a valid method name. This is particularly useful for generating JUnit test method names.- Specified by:
getUniqueNamein classClassTool.Sub<T extends ClassTool.CallableSub>- Returns:
- inspected callable unique name
-
getSignature
public java.lang.String getSignature()
Get (and cache) inspected callable signature- Returns:
- inspected callable signature
-
getJavadocRef
public java.lang.String getJavadocRef()
- Specified by:
getJavadocRefin classClassTool.Sub<T extends ClassTool.CallableSub>- Returns:
- inspected callable javadoc ref
-
signature
protected java.lang.String signature(boolean fullNames)
Internal method to get the inspected callable signature.- Parameters:
fullNames- whether to use full names- Returns:
- inspected callable signature
-
-