Package gw.internal.gosu.parser
Class AsmClassJavaClassInfo
- java.lang.Object
-
- gw.lang.reflect.java.JavaSourceElement
-
- gw.internal.gosu.parser.AsmTypeJavaClassType
-
- gw.internal.gosu.parser.AsmClassJavaClassInfo
-
- All Implemented Interfaces:
IAsmJavaClassInfo
,IJavaAnnotatedElement
,IJavaClassInfo
,IJavaClassType
,ITypeInfoResolver
,Serializable
public class AsmClassJavaClassInfo extends AsmTypeJavaClassType implements IAsmJavaClassInfo
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gw.lang.reflect.java.IJavaClassInfo
IJavaClassInfo.Util
-
-
Field Summary
-
Fields inherited from class gw.internal.gosu.parser.AsmTypeJavaClassType
_module
-
Fields inherited from interface gw.lang.reflect.java.IJavaClassInfo
LOCK
-
Fields inherited from interface gw.lang.reflect.java.IJavaClassType
EMPTY_ARRAY, ERROR_TYPE, NULL_TYPE
-
-
Constructor Summary
Constructors Constructor Description AsmClassJavaClassInfo(AsmClass cls, IModule module)
-
Method Summary
-
Methods inherited from class gw.internal.gosu.parser.AsmTypeJavaClassType
createType, createType, getActualType, getActualType, getType
-
Methods inherited from class gw.lang.reflect.java.JavaSourceElement
findInnerSourceType, getLocationInfo
-
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
-
Methods inherited from interface gw.lang.reflect.java.IJavaClassInfo
compile, getDeclaredField, getField, isCompilable
-
Methods inherited from interface gw.lang.reflect.java.IJavaClassType
getActualType, getActualType, isAssignableFrom
-
-
-
-
Method Detail
-
isAnnotation
public boolean isAnnotation()
- Specified by:
isAnnotation
in interfaceIJavaClassInfo
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in interfaceIJavaClassInfo
-
getConcreteType
public IJavaClassType getConcreteType()
- Specified by:
getConcreteType
in interfaceIJavaClassType
-
getName
public String getName()
- Specified by:
getName
in interfaceIJavaClassType
- Overrides:
getName
in classAsmTypeJavaClassType
-
getNameSignature
public String getNameSignature()
- Specified by:
getNameSignature
in interfaceIJavaClassInfo
-
getMethod
public IJavaClassMethod getMethod(String methodName, IJavaClassInfo... paramTypes) throws NoSuchMethodException
- Specified by:
getMethod
in interfaceIJavaClassInfo
- Throws:
NoSuchMethodException
-
getDeclaredMethod
public IJavaClassMethod getDeclaredMethod(String methodName, IJavaClassInfo... paramTypes) throws NoSuchMethodException
- Specified by:
getDeclaredMethod
in interfaceIJavaClassInfo
- Throws:
NoSuchMethodException
-
getDeclaredMethods
public IJavaClassMethod[] getDeclaredMethods()
- Specified by:
getDeclaredMethods
in interfaceIJavaClassInfo
-
newInstance
public Object newInstance() throws InstantiationException, IllegalAccessException
- Specified by:
newInstance
in interfaceIJavaClassInfo
- Throws:
InstantiationException
IllegalAccessException
-
getEnumConstants
public Object[] getEnumConstants()
- Specified by:
getEnumConstants
in interfaceIJavaClassInfo
-
getJavaType
public IType getJavaType()
- Specified by:
getJavaType
in interfaceIJavaClassInfo
-
setJavaType
public void setJavaType(IJavaType javaType)
-
getInterfaces
public IJavaClassInfo[] getInterfaces()
- Specified by:
getInterfaces
in interfaceIJavaClassInfo
-
getSuperclass
public IJavaClassInfo getSuperclass()
- Specified by:
getSuperclass
in interfaceIJavaClassInfo
-
getTypeParameters
public IJavaClassTypeVariable[] getTypeParameters()
- Specified by:
getTypeParameters
in interfaceIJavaClassInfo
-
getDeclaredFields
public IJavaClassField[] getDeclaredFields()
- Specified by:
getDeclaredFields
in interfaceIJavaClassInfo
-
getDeclaredConstructors
public IJavaClassConstructor[] getDeclaredConstructors()
- Specified by:
getDeclaredConstructors
in interfaceIJavaClassInfo
-
getConstructor
public IJavaClassConstructor getConstructor(IJavaClassInfo... paramTypes) throws NoSuchMethodException
- Specified by:
getConstructor
in interfaceIJavaClassInfo
- Throws:
NoSuchMethodException
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
Description copied from interface:IJavaAnnotatedElement
Returns 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:
isAnnotationPresent
in 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(Class annotationClass)
Description copied from interface:IJavaAnnotatedElement
Returns this element's annotation for the specified type if such an annotation is present, else null.- Specified by:
getAnnotation
in 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:IJavaAnnotatedElement
Returns 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:
getDeclaredAnnotations
in interfaceIJavaAnnotatedElement
- Returns:
- All annotations directly present on this element
-
createClassDocNode
public IClassDocNode createClassDocNode()
- Specified by:
createClassDocNode
in interfaceIJavaClassInfo
-
getPropertyDescriptors
public IJavaPropertyDescriptor[] getPropertyDescriptors()
- Specified by:
getPropertyDescriptors
in interfaceIJavaClassInfo
-
getMethodDescriptors
public IJavaMethodDescriptor[] getMethodDescriptors()
- Specified by:
getMethodDescriptors
in interfaceIJavaClassInfo
-
hasCustomBeanInfo
public boolean hasCustomBeanInfo()
- Specified by:
hasCustomBeanInfo
in interfaceIJavaClassInfo
-
getRelativeName
public String getRelativeName()
- Specified by:
getRelativeName
in interfaceIJavaClassInfo
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceIJavaClassInfo
-
getSimpleName
public String getSimpleName()
- Specified by:
getSimpleName
in interfaceIJavaClassType
-
isVisibleViaFeatureDescriptor
public boolean isVisibleViaFeatureDescriptor(IScriptabilityModifier constraint)
- Specified by:
isVisibleViaFeatureDescriptor
in interfaceIJavaClassInfo
-
isHiddenViaFeatureDescriptor
public boolean isHiddenViaFeatureDescriptor()
- Specified by:
isHiddenViaFeatureDescriptor
in interfaceIJavaClassInfo
-
getFields
public IJavaClassField[] getFields()
- Specified by:
getFields
in interfaceIJavaClassInfo
-
getAsmType
public AsmClass getAsmType()
- Specified by:
getAsmType
in interfaceIAsmJavaClassInfo
-
getComponentType
public IJavaClassInfo getComponentType()
- Specified by:
getComponentType
in interfaceIJavaClassInfo
- Specified by:
getComponentType
in interfaceIJavaClassType
- Overrides:
getComponentType
in classAsmTypeJavaClassType
-
isArray
public boolean isArray()
- Specified by:
isArray
in interfaceIJavaClassInfo
- Specified by:
isArray
in interfaceIJavaClassType
- Overrides:
isArray
in classAsmTypeJavaClassType
-
isEnum
public boolean isEnum()
- Specified by:
isEnum
in interfaceIJavaClassInfo
-
getModifiers
public int getModifiers()
- Specified by:
getModifiers
in interfaceIJavaClassInfo
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in interfaceIJavaClassInfo
-
getEnclosingClass
public IJavaClassInfo getEnclosingClass()
- Specified by:
getEnclosingClass
in interfaceIJavaAnnotatedElement
- Specified by:
getEnclosingClass
in classJavaSourceElement
-
getDeclaringClass
public IJavaClassInfo getDeclaringClass()
- Overrides:
getDeclaringClass
in classJavaSourceElement
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingType
in interfaceIJavaClassInfo
-
getNamespace
public String getNamespace()
- Specified by:
getNamespace
in interfaceIJavaClassType
- Overrides:
getNamespace
in classAsmTypeJavaClassType
-
getGenericInterfaces
public IJavaClassType[] getGenericInterfaces()
- Specified by:
getGenericInterfaces
in interfaceIJavaClassInfo
-
getGenericSuperclass
public IJavaClassType getGenericSuperclass()
- Specified by:
getGenericSuperclass
in interfaceIJavaClassInfo
-
getArrayType
public IJavaClassInfo getArrayType()
- Specified by:
getArrayType
in interfaceIJavaClassInfo
-
getDeclaredClasses
public IJavaClassInfo[] getDeclaredClasses()
- Specified by:
getDeclaredClasses
in interfaceIJavaClassInfo
-
isAssignableFrom
public boolean isAssignableFrom(IJavaClassInfo aClass)
- Specified by:
isAssignableFrom
in interfaceIJavaClassInfo
-
isPublic
public boolean isPublic()
- Specified by:
isPublic
in interfaceIJavaClassInfo
-
isProtected
public boolean isProtected()
- Specified by:
isProtected
in interfaceIJavaClassInfo
-
isInternal
public boolean isInternal()
- Specified by:
isInternal
in interfaceIJavaClassInfo
-
isPrivate
public boolean isPrivate()
- Specified by:
isPrivate
in interfaceIJavaClassInfo
-
equals
public boolean equals(Object obj)
Description copied from interface:IJavaClassInfo
Two IJavaClassInfo instances are equal if they are both non-arrays and have the same name and module. If the two instances are arrays, then they are equal if their component types are equal.- Specified by:
equals
in interfaceIJavaClassInfo
- Overrides:
equals
in classAsmTypeJavaClassType
- Parameters:
obj
- the other object- Returns:
- whether the two objects represent the same class.
-
hashCode
public int hashCode()
Description copied from interface:IJavaClassInfo
In order to maintain consistency withIJavaClassInfo.equals(Object)
, the hash code of a non-array IJavaClassInfo must be computed as follows:getName().hashCode() * 31 + getModule().hashCode()
For arrays, the hashCode is equal to the hashCode of the component type.- Specified by:
hashCode
in interfaceIJavaClassInfo
- Overrides:
hashCode
in classAsmTypeJavaClassType
- Returns:
- the hash code
-
getBackingClass
public Class getBackingClass()
- Specified by:
getBackingClass
in interfaceIJavaClassInfo
-
getSourceFileHandle
public ISourceFileHandle getSourceFileHandle()
- Specified by:
getSourceFileHandle
in interfaceIJavaClassInfo
-
getTree
public com.sun.source.tree.Tree getTree()
- Specified by:
getTree
in classJavaSourceElement
-
getCompilationUnitTree
public com.sun.source.tree.CompilationUnitTree getCompilationUnitTree()
- Overrides:
getCompilationUnitTree
in classJavaSourceElement
-
getSourcePositions
public com.sun.source.util.SourcePositions getSourcePositions()
- Overrides:
getSourcePositions
in classJavaSourceElement
-
getStartPosition
public int getStartPosition()
- Overrides:
getStartPosition
in classJavaSourceElement
-
getEndPosition
public int getEndPosition()
- Overrides:
getEndPosition
in classJavaSourceElement
-
getModule
public IModule getModule()
- Specified by:
getModule
in interfaceIJavaClassType
- Specified by:
getModule
in interfaceITypeInfoResolver
- Overrides:
getModule
in classAsmTypeJavaClassType
-
resolveType
public IJavaClassType resolveType(String relativeName, int ignoreFlags)
- Specified by:
resolveType
in interfaceITypeInfoResolver
-
getDeepestClassAtOffset
public IJavaClassInfo getDeepestClassAtOffset(int offset)
- Specified by:
getDeepestClassAtOffset
in interfaceIJavaClassInfo
-
resolveType
public IJavaClassType resolveType(String relativeName, IJavaClassInfo whosAskin, int ignoreFlags)
- Specified by:
resolveType
in interfaceITypeInfoResolver
-
resolveImport
public IJavaClassType resolveImport(String relativeName)
- Specified by:
resolveImport
in interfaceITypeInfoResolver
-
-