}
/**
- * Returns the character string representing the parameter types
- * and the return type. If two methods/constructors have
+ * Returns the method signature (the parameter types
+ * and the return type).
+ * The method signature is represented by a character string
+ * called method descriptor, which is defined in the JVM specification.
+ * If two methods/constructors have
* the same parameter types
* and the return type, <code>getSignature()</code> returns the
* same string (the return type of constructors is <code>void</code>).
+ *
+ * @see javassist.bytecode.Descriptor
*/
public String getSignature() {
return methodInfo.getDescriptor();
*
* @param name method name
* @param desc method descriptor
+ * @see CtBehavior.getSignature()
* @see javassist.bytecode.Descriptor
*/
public CtMethod getMethod(String name, String desc)
* Returns the called constructor.
*/
public CtConstructor getConstructor() throws NotFoundException {
- return getCtClass().getConstructor(getMethodDesc());
+ return getCtClass().getConstructor(getSignature());
}
/**
* Returns the called method.
*/
public CtMethod getMethod() throws NotFoundException {
- return getCtClass().getMethod(getMethodName(), getMethodDesc());
+ return getCtClass().getMethod(getMethodName(), getSignature());
}
/**
- * Returns the descriptor of the called method.
+ * Returns the method signature (the parameter types
+ * and the return type).
+ * The method signature is represented by a character string
+ * called method descriptor, which is defined in the JVM specification.
+ *
+ * @see javassist.CtBehavior.getSignature()
+ * @see javassist.bytecode.Descriptor
+ * @since 3.1
*/
- protected String getMethodDesc() {
+ public String getSignature() {
ConstPool cp = getConstPool();
int nt = getNameAndType(cp);
return cp.getUtf8Info(cp.getNameAndTypeDescriptor(nt));