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,java.io.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 Modifier and Type Field Description private IJavaClassField[]_allFieldsprivate AsmClass_classprivate IAnnotationInfo[]_declaredAnnotationsprivate IJavaClassInfo[]_declaredClassesprivate IJavaClassConstructor[]_declaredConstructorsprivate IJavaClassField[]_declaredFieldsprivate IJavaClassMethod[]_declaredMethodsprivate LocklessLazyVar<IType>_enclosingClassprivate IEnumValue[]_enumConstantsprivate IJavaClassType[]_genericInterfacesprivate IJavaClassInfo[]_interfacesprivate IType_javaTypeprivate IJavaMethodDescriptor[]_methodDescriptorsprivate java.lang.String_namespaceprivate IJavaPropertyDescriptor[]_propertyDescriptorsprivate java.lang.String_simpleNameprivate ISourceFileHandle_sourceFileHandleprivate IJavaClassInfo_sourceTypeprivate IJavaClassInfo_superclassprivate IJavaClassTypeVariable[]_typeVariables-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IClassDocNodecreateClassDocNode()booleanequals(java.lang.Object obj)Two IJavaClassInfo instances are equal if they are both non-arrays and have the same name and module.private JavaSourceElementfindSourceClass()private ISourceFileHandlefindSourceFile()IAnnotationInfogetAnnotation(java.lang.Class annotationClass)Returns this element's annotation for the specified type if such an annotation is present, else null.IJavaClassInfogetArrayType()AsmClassgetAsmType()java.lang.ClassgetBackingClass()com.sun.source.tree.CompilationUnitTreegetCompilationUnitTree()IJavaClassInfogetComponentType()IJavaClassTypegetConcreteType()IJavaClassConstructorgetConstructor(IJavaClassInfo... paramTypes)IAnnotationInfo[]getDeclaredAnnotations()Returns all annotations that are directly present on this element.IJavaClassInfo[]getDeclaredClasses()IJavaClassConstructor[]getDeclaredConstructors()IJavaClassField[]getDeclaredFields()IJavaClassMethodgetDeclaredMethod(java.lang.String methodName, IJavaClassInfo... paramTypes)IJavaClassMethod[]getDeclaredMethods()IJavaClassInfogetDeclaringClass()IJavaClassInfogetDeepestClassAtOffset(int offset)java.lang.StringgetDisplayName()IJavaClassInfogetEnclosingClass()ITypegetEnclosingType()intgetEndPosition()java.lang.Object[]getEnumConstants()IJavaClassField[]getFields()IJavaClassType[]getGenericInterfaces()IJavaClassTypegetGenericSuperclass()IJavaClassInfo[]getInterfaces()ITypegetJavaType()IJavaClassMethodgetMethod(java.lang.String methodName, IJavaClassInfo... paramTypes)IJavaMethodDescriptor[]getMethodDescriptors()intgetModifiers()IModulegetModule()java.lang.StringgetName()java.lang.StringgetNameSignature()java.lang.StringgetNamespace()IJavaPropertyDescriptor[]getPropertyDescriptors()java.lang.StringgetRelativeName()java.lang.StringgetSimpleName()ISourceFileHandlegetSourceFileHandle()com.sun.source.util.SourcePositionsgetSourcePositions()intgetStartPosition()IJavaClassInfogetSuperclass()com.sun.source.tree.TreegetTree()IJavaClassTypeVariable[]getTypeParameters()booleanhasCustomBeanInfo()inthashCode()In order to maintain consistency withIJavaClassInfo.equals(Object), the hash code of a non-array IJavaClassInfo must be computed as follows:booleanisAnnotation()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.booleanisArray()booleanisAssignableFrom(IJavaClassInfo aClass)booleanisEnum()booleanisHiddenViaFeatureDescriptor()booleanisInterface()booleanisInternal()booleanisPrimitive()booleanisPrivate()booleanisProtected()booleanisPublic()booleanisVisibleViaFeatureDescriptor(IScriptabilityModifier constraint)private java.lang.StringmakeClassFileName()java.lang.ObjectnewInstance()IJavaClassTyperesolveImport(java.lang.String relativeName)IJavaClassTyperesolveType(java.lang.String relativeName, int ignoreFlags)IJavaClassTyperesolveType(java.lang.String relativeName, IJavaClassInfo whosAskin, int ignoreFlags)voidsetJavaType(IJavaType javaType)java.lang.StringtoString()-
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
-
-
-
-
Field Detail
-
_class
private AsmClass _class
-
_declaredMethods
private IJavaClassMethod[] _declaredMethods
-
_interfaces
private IJavaClassInfo[] _interfaces
-
_superclass
private IJavaClassInfo _superclass
-
_typeVariables
private IJavaClassTypeVariable[] _typeVariables
-
_declaredFields
private IJavaClassField[] _declaredFields
-
_declaredConstructors
private IJavaClassConstructor[] _declaredConstructors
-
_declaredAnnotations
private IAnnotationInfo[] _declaredAnnotations
-
_propertyDescriptors
private IJavaPropertyDescriptor[] _propertyDescriptors
-
_methodDescriptors
private IJavaMethodDescriptor[] _methodDescriptors
-
_allFields
private IJavaClassField[] _allFields
-
_genericInterfaces
private IJavaClassType[] _genericInterfaces
-
_declaredClasses
private IJavaClassInfo[] _declaredClasses
-
_enclosingClass
private LocklessLazyVar<IType> _enclosingClass
-
_enumConstants
private IEnumValue[] _enumConstants
-
_simpleName
private java.lang.String _simpleName
-
_namespace
private java.lang.String _namespace
-
_javaType
private IType _javaType
-
_sourceFileHandle
private ISourceFileHandle _sourceFileHandle
-
_sourceType
private IJavaClassInfo _sourceType
-
-
Method Detail
-
isAnnotation
public boolean isAnnotation()
- Specified by:
isAnnotationin interfaceIJavaClassInfo
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfaceIJavaClassInfo
-
getConcreteType
public IJavaClassType getConcreteType()
- Specified by:
getConcreteTypein interfaceIJavaClassType
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceIJavaClassType- Overrides:
getNamein classAsmTypeJavaClassType
-
getNameSignature
public java.lang.String getNameSignature()
- Specified by:
getNameSignaturein interfaceIJavaClassInfo
-
getMethod
public IJavaClassMethod getMethod(java.lang.String methodName, IJavaClassInfo... paramTypes) throws java.lang.NoSuchMethodException
- Specified by:
getMethodin interfaceIJavaClassInfo- Throws:
java.lang.NoSuchMethodException
-
getDeclaredMethod
public IJavaClassMethod getDeclaredMethod(java.lang.String methodName, IJavaClassInfo... paramTypes) throws java.lang.NoSuchMethodException
- Specified by:
getDeclaredMethodin interfaceIJavaClassInfo- Throws:
java.lang.NoSuchMethodException
-
getDeclaredMethods
public IJavaClassMethod[] getDeclaredMethods()
- Specified by:
getDeclaredMethodsin interfaceIJavaClassInfo
-
newInstance
public java.lang.Object newInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException- Specified by:
newInstancein interfaceIJavaClassInfo- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessException
-
getEnumConstants
public java.lang.Object[] getEnumConstants()
- Specified by:
getEnumConstantsin interfaceIJavaClassInfo
-
getJavaType
public IType getJavaType()
- Specified by:
getJavaTypein interfaceIJavaClassInfo
-
setJavaType
public void setJavaType(IJavaType javaType)
-
getInterfaces
public IJavaClassInfo[] getInterfaces()
- Specified by:
getInterfacesin interfaceIJavaClassInfo
-
getSuperclass
public IJavaClassInfo getSuperclass()
- Specified by:
getSuperclassin interfaceIJavaClassInfo
-
getTypeParameters
public IJavaClassTypeVariable[] getTypeParameters()
- Specified by:
getTypeParametersin interfaceIJavaClassInfo
-
getDeclaredFields
public IJavaClassField[] getDeclaredFields()
- Specified by:
getDeclaredFieldsin interfaceIJavaClassInfo
-
getDeclaredConstructors
public IJavaClassConstructor[] getDeclaredConstructors()
- Specified by:
getDeclaredConstructorsin interfaceIJavaClassInfo
-
getConstructor
public IJavaClassConstructor getConstructor(IJavaClassInfo... paramTypes) throws java.lang.NoSuchMethodException
- Specified by:
getConstructorin interfaceIJavaClassInfo- Throws:
java.lang.NoSuchMethodException
-
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
-
createClassDocNode
public IClassDocNode createClassDocNode()
- Specified by:
createClassDocNodein interfaceIJavaClassInfo
-
getPropertyDescriptors
public IJavaPropertyDescriptor[] getPropertyDescriptors()
- Specified by:
getPropertyDescriptorsin interfaceIJavaClassInfo
-
getMethodDescriptors
public IJavaMethodDescriptor[] getMethodDescriptors()
- Specified by:
getMethodDescriptorsin interfaceIJavaClassInfo
-
hasCustomBeanInfo
public boolean hasCustomBeanInfo()
- Specified by:
hasCustomBeanInfoin interfaceIJavaClassInfo
-
getRelativeName
public java.lang.String getRelativeName()
- Specified by:
getRelativeNamein interfaceIJavaClassInfo
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein interfaceIJavaClassInfo
-
getSimpleName
public java.lang.String getSimpleName()
- Specified by:
getSimpleNamein interfaceIJavaClassType
-
isVisibleViaFeatureDescriptor
public boolean isVisibleViaFeatureDescriptor(IScriptabilityModifier constraint)
- Specified by:
isVisibleViaFeatureDescriptorin interfaceIJavaClassInfo
-
isHiddenViaFeatureDescriptor
public boolean isHiddenViaFeatureDescriptor()
- Specified by:
isHiddenViaFeatureDescriptorin interfaceIJavaClassInfo
-
getFields
public IJavaClassField[] getFields()
- Specified by:
getFieldsin interfaceIJavaClassInfo
-
getAsmType
public AsmClass getAsmType()
- Specified by:
getAsmTypein interfaceIAsmJavaClassInfo
-
getComponentType
public IJavaClassInfo getComponentType()
- Specified by:
getComponentTypein interfaceIJavaClassInfo- Specified by:
getComponentTypein interfaceIJavaClassType- Overrides:
getComponentTypein classAsmTypeJavaClassType
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceIJavaClassInfo- Specified by:
isArrayin interfaceIJavaClassType- Overrides:
isArrayin classAsmTypeJavaClassType
-
isEnum
public boolean isEnum()
- Specified by:
isEnumin interfaceIJavaClassInfo
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin interfaceIJavaClassInfo
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfaceIJavaClassInfo
-
getEnclosingClass
public IJavaClassInfo getEnclosingClass()
- Specified by:
getEnclosingClassin interfaceIJavaAnnotatedElement- Specified by:
getEnclosingClassin classJavaSourceElement
-
getDeclaringClass
public IJavaClassInfo getDeclaringClass()
- Overrides:
getDeclaringClassin classJavaSourceElement
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingTypein interfaceIJavaClassInfo
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceIJavaClassType- Overrides:
getNamespacein classAsmTypeJavaClassType
-
getGenericInterfaces
public IJavaClassType[] getGenericInterfaces()
- Specified by:
getGenericInterfacesin interfaceIJavaClassInfo
-
getGenericSuperclass
public IJavaClassType getGenericSuperclass()
- Specified by:
getGenericSuperclassin interfaceIJavaClassInfo
-
getArrayType
public IJavaClassInfo getArrayType()
- Specified by:
getArrayTypein interfaceIJavaClassInfo
-
getDeclaredClasses
public IJavaClassInfo[] getDeclaredClasses()
- Specified by:
getDeclaredClassesin interfaceIJavaClassInfo
-
isAssignableFrom
public boolean isAssignableFrom(IJavaClassInfo aClass)
- Specified by:
isAssignableFromin interfaceIJavaClassInfo
-
isPublic
public boolean isPublic()
- Specified by:
isPublicin interfaceIJavaClassInfo
-
isProtected
public boolean isProtected()
- Specified by:
isProtectedin interfaceIJavaClassInfo
-
isInternal
public boolean isInternal()
- Specified by:
isInternalin interfaceIJavaClassInfo
-
isPrivate
public boolean isPrivate()
- Specified by:
isPrivatein interfaceIJavaClassInfo
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:IJavaClassInfoTwo 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:
equalsin interfaceIJavaClassInfo- Overrides:
equalsin classAsmTypeJavaClassType- Parameters:
obj- the other object- Returns:
- whether the two objects represent the same class.
-
hashCode
public int hashCode()
Description copied from interface:IJavaClassInfoIn 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:
hashCodein interfaceIJavaClassInfo- Overrides:
hashCodein classAsmTypeJavaClassType- Returns:
- the hash code
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getBackingClass
public java.lang.Class getBackingClass()
- Specified by:
getBackingClassin interfaceIJavaClassInfo
-
getSourceFileHandle
public ISourceFileHandle getSourceFileHandle()
- Specified by:
getSourceFileHandlein interfaceIJavaClassInfo
-
findSourceFile
private ISourceFileHandle findSourceFile()
-
makeClassFileName
private java.lang.String makeClassFileName()
-
getTree
public com.sun.source.tree.Tree getTree()
- Specified by:
getTreein classJavaSourceElement
-
getCompilationUnitTree
public com.sun.source.tree.CompilationUnitTree getCompilationUnitTree()
- Overrides:
getCompilationUnitTreein classJavaSourceElement
-
getSourcePositions
public com.sun.source.util.SourcePositions getSourcePositions()
- Overrides:
getSourcePositionsin classJavaSourceElement
-
getStartPosition
public int getStartPosition()
- Overrides:
getStartPositionin classJavaSourceElement
-
getEndPosition
public int getEndPosition()
- Overrides:
getEndPositionin classJavaSourceElement
-
findSourceClass
private JavaSourceElement findSourceClass()
-
getModule
public IModule getModule()
- Specified by:
getModulein interfaceIJavaClassType- Specified by:
getModulein interfaceITypeInfoResolver- Overrides:
getModulein classAsmTypeJavaClassType
-
resolveType
public IJavaClassType resolveType(java.lang.String relativeName, int ignoreFlags)
- Specified by:
resolveTypein interfaceITypeInfoResolver
-
getDeepestClassAtOffset
public IJavaClassInfo getDeepestClassAtOffset(int offset)
- Specified by:
getDeepestClassAtOffsetin interfaceIJavaClassInfo
-
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
-
-