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:
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>
Since:
VelocityTools 2.0
Version:
$Id: ClassTool.java 463298 2006-10-12 16:10:32Z henning $
Author:
Nathan Bubna
  • Field Details

    • uniqueName

      protected String uniqueName
    • javadocRef

      protected String javadocRef
    • signature

      protected String signature
  • Constructor Details

    • CallableSub

      public CallableSub()
  • Method Details

    • getParameters

      public abstract 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 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:
      getUniqueName in class ClassTool.Sub<T extends ClassTool.CallableSub>
      Returns:
      inspected callable unique name
    • getSignature

      public String getSignature()
      Get (and cache) inspected callable signature
      Returns:
      inspected callable signature
    • getJavadocRef

      public String getJavadocRef()
      Specified by:
      getJavadocRef in class ClassTool.Sub<T extends ClassTool.CallableSub>
      Returns:
      inspected callable javadoc ref
    • signature

      protected String signature(boolean fullNames)
      Internal method to get the inspected callable signature.
      Parameters:
      fullNames - whether to use full names
      Returns:
      inspected callable signature