|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.webservices.util.MethodSignature
A common representation for Java method signatures.
Field Summary | |
static int |
INVALID_METHOD_NAME Method name is invalid. |
static int |
INVALID_PARAMETER_NAME Parameter name is invalid. |
static int |
INVALID_PARAMETER_TYPE Parameter type is invalid. |
static int |
INVALID_RETURN_TYPE Method return type is invalid. |
static int |
OK Method signature is valid. |
Constructor Summary | |
MethodSignature() Default no-arg constructor for Object2Dom marshalling. |
|
MethodSignature(int modifiers, java.lang.String methodName, java.lang.String returnType) Construct a MethodSignature object will the signature data. |
|
MethodSignature(JotMethod method) Construct a MethodSignature object based on the JotMethod supplied. |
|
MethodSignature(java.lang.String methodName, java.lang.String returnType) Construct a MethodSignature object will the signature data. |
Method Summary | |
void |
addParameter(java.lang.String paramType, java.lang.String paramName) Add a parameter to the method (parameters must be added in the correct order). |
void |
clearParams() Clear the existing parameters. |
boolean |
equals(java.lang.Object o2) Check whether this signature is the same as another. |
JotMethod |
findMethod(JotClass searchClass) Search the supplied JotClass for a method whose signature matches the one encoded in this MethodSignature, and return it. |
JotClass |
getDeclaringClass(JotClass searchClass) Search the supplied JotClass for a method whose signature matches the one encoded in this MethodSignature, and return the JotClass in which that method is declared. |
int |
getModifiers() Get the modifiers for this method. |
java.lang.String |
getName() Get the name of the method. |
java.lang.String[] |
getParamNames() Get the parameter names (in method signature order). |
java.lang.String[] |
getParamTypes() Get the parameter types (in method signature order). |
java.lang.String |
getReturnType() Get the method's return type. |
static void |
main(java.lang.String[] args) |
boolean |
matchesJotMethod(JotMethod jotMethod) Check whether this signature matches that of the supplied JotMethod. |
static MethodSignature |
parse(java.lang.String sig) Parse the supplied string and create a MethodSignature from it. |
void |
setModifiers(int modifiers) Set the modifiers for this method. |
void |
setName(java.lang.String methodName) Set the name of the method. |
void |
setParamNames(java.lang.String[] paramNames) Method for Object2Dom marshalling only. |
void |
setParamTypes(java.lang.String[] paramTypes) Method for Object2Dom marshalling only. |
void |
setReturnType(java.lang.String returnType) Set the method's return type. |
boolean |
signaturesEqual(MethodSignature comp, JotClass ctxClass) Check whether the signature of this method matches that of the one supplied. |
java.lang.String |
toString() |
boolean |
typesMatch(java.lang.String type1, java.lang.String type2, JotClass ctxClass) Compare the two types given and return true if they are the same. |
int |
validate(JotClass ctxClass) Validate each of the components of the method signature and return a code indicating if any errors were found. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OK
public static final int INVALID_METHOD_NAME
public static final int INVALID_RETURN_TYPE
public static final int INVALID_PARAMETER_NAME
public static final int INVALID_PARAMETER_TYPE
Constructor Detail |
public MethodSignature()
public MethodSignature(java.lang.String methodName, java.lang.String returnType)
public MethodSignature(int modifiers, java.lang.String methodName, java.lang.String returnType)
public MethodSignature(JotMethod method)
method
- JotMethod on which to base the MethodSignature.Method Detail |
public void setModifiers(int modifiers)
public int getModifiers()
public void setName(java.lang.String methodName)
public java.lang.String getName()
public void setReturnType(java.lang.String returnType)
public java.lang.String getReturnType()
public void addParameter(java.lang.String paramType, java.lang.String paramName)
public void setParamTypes(java.lang.String[] paramTypes)
public java.lang.String[] getParamTypes()
public void setParamNames(java.lang.String[] paramNames)
public java.lang.String[] getParamNames()
public void clearParams()
public java.lang.String toString()
public JotMethod findMethod(JotClass searchClass)
searchClass
- The JotClass to search.public JotClass getDeclaringClass(JotClass searchClass)
searchClass
- The JotClass to search.public boolean matchesJotMethod(JotMethod jotMethod)
jotMethod
- The JotMethod whose signature we should compare against.public boolean equals(java.lang.Object o2)
o2
- Other object to compare against this signature.public boolean signaturesEqual(MethodSignature comp, JotClass ctxClass)
comp
- The signature to compare against.ctxClass
- The JotClass that is the context for the comparison.public boolean typesMatch(java.lang.String type1, java.lang.String type2, JotClass ctxClass)
type1
- Name of the first type to compare.type2
- Name of the second type to compare.ctxClass
- The class in which the types appear, required for context.public int validate(JotClass ctxClass)
ctxClass
- Class that the signature will belong to.public static void main(java.lang.String[] args)
public static MethodSignature parse(java.lang.String sig)
methodName (methodType1[, methodType2 ...]) [: methodReturnType]In other words, this method isn't to be used for parsing Java signatures straight out of a source file. It should be used only to parse strings of the form produced by MethodSignature.toString().
sig
- String containing the signature to parse.
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.