Class JavaSourceMethod
- java.lang.Object
-
- gw.lang.reflect.java.JavaSourceElement
-
- gw.internal.gosu.parser.java.classinfo.JavaSourceMethod
-
- All Implemented Interfaces:
IJavaAnnotatedElement,IJavaClassMethod,ITypeInfoResolver,java.io.Serializable,java.lang.Comparable<IJavaClassMethod>
- Direct Known Subclasses:
JavaSourceAnnotationMethod,JavaSourceConstructor
public class JavaSourceMethod extends JavaSourceElement implements IJavaClassMethod, ITypeInfoResolver
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JavaSourceType_containingClassprotected IJavaClassType[]_genericParameterTypesprotected IJavaClassType_genericReturnTypeprotected com.sun.source.tree.MethodTree_methodprotected JavaSourceModifierList_modifierListprotected JavaSourceParameter[]_parametersprotected IJavaClassInfo[]_parameterTypesprotected IJavaClassInfo_returnTypeprotected IJavaClassTypeVariable[]_typeParameters
-
Constructor Summary
Constructors Constructor Description JavaSourceMethod(com.sun.source.tree.MethodTree method, JavaSourceType containingClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(IJavaClassMethod o)static JavaSourceMethodcreate(com.sun.source.tree.MethodTree method, JavaSourceType containingClass)booleanequals(java.lang.Object o)protected IParameterInfo[]getActualParameterInfos(IFeatureInfo container, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)IAnnotationInfogetAnnotation(java.lang.Class annotationClass)Returns this element's annotation for the specified type if such an annotation is present, else null.IAnnotationInfo[]getDeclaredAnnotations()Returns all annotations that are directly present on this element.java.lang.ObjectgetDefaultValue()JavaSourceTypegetEnclosingClass()IJavaClassInfo[]getExceptionTypes()IJavaClassType[]getGenericParameterTypes()IJavaClassTypegetGenericReturnType()IModifierListgetModifierList()intgetModifiers()IModulegetModule()java.lang.StringgetName()java.util.List<Parameter>getParameterInfos()JavaSourceParameter[]getParameters()IJavaClassInfo[]getParameterTypes()IJavaClassInfogetReturnClassInfo()ITypegetReturnType()java.lang.StringgetReturnTypeName()com.sun.source.tree.TreegetTree()IJavaClassTypeVariable[]getTypeParameters()IGenericTypeVariable[]getTypeVariables(IJavaMethodInfo mi)inthashCode()protected IJavaClassType[]initGenericParameterTypes()protected IJavaClassInfo[]initParameterTypes()java.lang.Objectinvoke(java.lang.Object ctx, java.lang.Object[] args)booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Returns true if an annotation for the specified type is present on this element, else false.booleanisBridge()booleanisConstructor()booleanisSynthetic()IJavaClassTyperesolveImport(java.lang.String relativeName)IJavaClassTyperesolveType(java.lang.String relativeName, int ignoreFlags)IJavaClassTyperesolveType(java.lang.String relativeName, IJavaClassInfo whosAskin, int ignoreFlags)java.lang.StringtoString()-
Methods inherited from class gw.lang.reflect.java.JavaSourceElement
findInnerSourceType, getCompilationUnitTree, getDeclaringClass, getEndPosition, getLocationInfo, getSourcePositions, getStartPosition
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.java.IJavaAnnotatedElement
getLocationInfo
-
-
-
-
Field Detail
-
_method
protected com.sun.source.tree.MethodTree _method
-
_containingClass
protected JavaSourceType _containingClass
-
_parameters
protected JavaSourceParameter[] _parameters
-
_genericReturnType
protected IJavaClassType _genericReturnType
-
_modifierList
protected JavaSourceModifierList _modifierList
-
_typeParameters
protected IJavaClassTypeVariable[] _typeParameters
-
_genericParameterTypes
protected IJavaClassType[] _genericParameterTypes
-
_parameterTypes
protected IJavaClassInfo[] _parameterTypes
-
_returnType
protected IJavaClassInfo _returnType
-
-
Constructor Detail
-
JavaSourceMethod
public JavaSourceMethod(com.sun.source.tree.MethodTree method, JavaSourceType containingClass)
-
-
Method Detail
-
getReturnClassInfo
public IJavaClassInfo getReturnClassInfo()
- Specified by:
getReturnClassInfoin interfaceIJavaClassMethod
-
getGenericReturnType
public IJavaClassType getGenericReturnType()
- Specified by:
getGenericReturnTypein interfaceIJavaClassMethod
-
getReturnTypeName
public java.lang.String getReturnTypeName()
- Specified by:
getReturnTypeNamein interfaceIJavaClassMethod
-
getReturnType
public IType getReturnType()
- Specified by:
getReturnTypein interfaceIJavaClassMethod
-
getGenericParameterTypes
public IJavaClassType[] getGenericParameterTypes()
- Specified by:
getGenericParameterTypesin interfaceIJavaClassMethod
-
getParameterTypes
public IJavaClassInfo[] getParameterTypes()
- Specified by:
getParameterTypesin interfaceIJavaClassMethod
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceIJavaClassMethod
-
getParameterInfos
public java.util.List<Parameter> getParameterInfos()
- Specified by:
getParameterInfosin interfaceIJavaClassMethod
-
getParameters
public JavaSourceParameter[] getParameters()
-
isConstructor
public boolean isConstructor()
-
getTree
public com.sun.source.tree.Tree getTree()
- Specified by:
getTreein classJavaSourceElement
-
getEnclosingClass
public JavaSourceType getEnclosingClass()
- Specified by:
getEnclosingClassin interfaceIJavaAnnotatedElement- Specified by:
getEnclosingClassin classJavaSourceElement
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin interfaceIJavaClassMethod
-
getModifierList
public IModifierList getModifierList()
-
getExceptionTypes
public IJavaClassInfo[] getExceptionTypes()
- Specified by:
getExceptionTypesin interfaceIJavaClassMethod
-
resolveType
public IJavaClassType resolveType(java.lang.String relativeName, int ignoreFlags)
- Specified by:
resolveTypein interfaceITypeInfoResolver
-
resolveType
public IJavaClassType resolveType(java.lang.String relativeName, IJavaClassInfo whosAskin, int ignoreFlags)
- Specified by:
resolveTypein interfaceITypeInfoResolver
-
resolveImport
public IJavaClassType resolveImport(java.lang.String relativeName)
- Specified by:
resolveImportin interfaceITypeInfoResolver
-
getModule
public IModule getModule()
- Specified by:
getModulein interfaceITypeInfoResolver
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Description copied from interface:IJavaAnnotatedElementReturns true if an annotation for the specified type is present on this element, else false. This method is designed primarily for convenient access to marker annotations.- Specified by:
isAnnotationPresentin interfaceIJavaAnnotatedElement- Parameters:
annotationClass- the Class object corresponding to the annotation type- Returns:
- true if an annotation for the specified annotation type is present on this element, else false
-
getAnnotation
public IAnnotationInfo getAnnotation(java.lang.Class annotationClass)
Description copied from interface:IJavaAnnotatedElementReturns this element's annotation for the specified type if such an annotation is present, else null.- Specified by:
getAnnotationin interfaceIJavaAnnotatedElement- Parameters:
annotationClass- the Class object corresponding to the annotation type- Returns:
- this element's annotation for the specified annotation type if present on this element, else null
-
getDeclaredAnnotations
public IAnnotationInfo[] getDeclaredAnnotations()
Description copied from interface:IJavaAnnotatedElementReturns all annotations that are directly present on this element. Unlike the other methods in this interface, this method ignores inherited annotations. (Returns an array of length zero if no annotations are directly present on this element.) The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.- Specified by:
getDeclaredAnnotationsin interfaceIJavaAnnotatedElement- Returns:
- All annotations directly present on this element
-
initParameterTypes
protected IJavaClassInfo[] initParameterTypes()
-
initGenericParameterTypes
protected IJavaClassType[] initGenericParameterTypes()
-
getDefaultValue
public java.lang.Object getDefaultValue()
- Specified by:
getDefaultValuein interfaceIJavaClassMethod
-
invoke
public java.lang.Object invoke(java.lang.Object ctx, java.lang.Object[] args) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException- Specified by:
invokein interfaceIJavaClassMethod- Throws:
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessException
-
getTypeParameters
public IJavaClassTypeVariable[] getTypeParameters()
-
getTypeVariables
public IGenericTypeVariable[] getTypeVariables(IJavaMethodInfo mi)
- Specified by:
getTypeVariablesin interfaceIJavaClassMethod
-
isBridge
public boolean isBridge()
- Specified by:
isBridgein interfaceIJavaClassMethod
-
isSynthetic
public boolean isSynthetic()
- Specified by:
isSyntheticin interfaceIJavaClassMethod
-
create
public static JavaSourceMethod create(com.sun.source.tree.MethodTree method, JavaSourceType containingClass)
-
getActualParameterInfos
protected IParameterInfo[] getActualParameterInfos(IFeatureInfo container, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(IJavaClassMethod o)
- Specified by:
compareToin interfacejava.lang.Comparable<IJavaClassMethod>
-
-