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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface gw.lang.reflect.java.IJavaClassInfo
IJavaClassInfo.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IJavaClassField[]
private AsmClass
private IAnnotationInfo[]
private IJavaClassInfo[]
private IJavaClassConstructor[]
private IJavaClassField[]
private IJavaClassMethod[]
private LocklessLazyVar<IType>
private IEnumValue[]
private IJavaClassType[]
private IJavaClassInfo[]
private IType
private IJavaMethodDescriptor[]
private String
private IJavaPropertyDescriptor[]
private String
private ISourceFileHandle
private IJavaClassInfo
private IJavaClassInfo
private IJavaClassTypeVariable[]
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
Two IJavaClassInfo instances are equal if they are both non-arrays and have the same name and module.private JavaSourceElement
private ISourceFileHandle
getAnnotation
(Class annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null.com.sun.source.tree.CompilationUnitTree
getConstructor
(IJavaClassInfo... paramTypes) Returns all annotations that are directly present on this element.getDeclaredMethod
(String methodName, IJavaClassInfo... paramTypes) getDeepestClassAtOffset
(int offset) int
Object[]
getMethod
(String methodName, IJavaClassInfo... paramTypes) int
getName()
com.sun.source.util.SourcePositions
int
com.sun.source.tree.Tree
getTree()
boolean
int
hashCode()
In order to maintain consistency withIJavaClassInfo.equals(Object)
, the hash code of a non-array IJavaClassInfo must be computed as follows:boolean
boolean
isAnnotationPresent
(Class<? extends Annotation> annotationClass) Returns true if an annotation for the specified type is present on this element, else false.boolean
isArray()
boolean
isAssignableFrom
(IJavaClassInfo aClass) boolean
isEnum()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isPublic()
boolean
isVisibleViaFeatureDescriptor
(IScriptabilityModifier constraint) private String
resolveImport
(String relativeName) resolveType
(String relativeName, int ignoreFlags) resolveType
(String relativeName, IJavaClassInfo whosAskin, int ignoreFlags) void
setJavaType
(IJavaType javaType) toString()
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 Details
-
_class
-
_declaredMethods
-
_interfaces
-
_superclass
-
_typeVariables
-
_declaredFields
-
_declaredConstructors
-
_declaredAnnotations
-
_propertyDescriptors
-
_methodDescriptors
-
_allFields
-
_genericInterfaces
-
_declaredClasses
-
_enclosingClass
-
_enumConstants
-
_simpleName
-
_namespace
-
_javaType
-
_sourceFileHandle
-
_sourceType
-
-
Constructor Details
-
AsmClassJavaClassInfo
-
-
Method Details
-
isAnnotation
public boolean isAnnotation()- Specified by:
isAnnotation
in interfaceIJavaClassInfo
-
isInterface
public boolean isInterface()- Specified by:
isInterface
in interfaceIJavaClassInfo
-
getConcreteType
- Specified by:
getConcreteType
in interfaceIJavaClassType
-
getName
- Specified by:
getName
in interfaceIJavaClassType
- Overrides:
getName
in classAsmTypeJavaClassType
-
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
- Specified by:
getDeclaredMethods
in interfaceIJavaClassInfo
-
newInstance
- Specified by:
newInstance
in interfaceIJavaClassInfo
- Throws:
InstantiationException
IllegalAccessException
-
getEnumConstants
- Specified by:
getEnumConstants
in interfaceIJavaClassInfo
-
getJavaType
- Specified by:
getJavaType
in interfaceIJavaClassInfo
-
setJavaType
-
getInterfaces
- Specified by:
getInterfaces
in interfaceIJavaClassInfo
-
getSuperclass
- Specified by:
getSuperclass
in interfaceIJavaClassInfo
-
getTypeParameters
- Specified by:
getTypeParameters
in interfaceIJavaClassInfo
-
getDeclaredFields
- Specified by:
getDeclaredFields
in interfaceIJavaClassInfo
-
getDeclaredConstructors
- Specified by:
getDeclaredConstructors
in interfaceIJavaClassInfo
-
getConstructor
public IJavaClassConstructor getConstructor(IJavaClassInfo... paramTypes) throws NoSuchMethodException - Specified by:
getConstructor
in interfaceIJavaClassInfo
- Throws:
NoSuchMethodException
-
isAnnotationPresent
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
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
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
- Specified by:
createClassDocNode
in interfaceIJavaClassInfo
-
getPropertyDescriptors
- Specified by:
getPropertyDescriptors
in interfaceIJavaClassInfo
-
getMethodDescriptors
- Specified by:
getMethodDescriptors
in interfaceIJavaClassInfo
-
hasCustomBeanInfo
public boolean hasCustomBeanInfo()- Specified by:
hasCustomBeanInfo
in interfaceIJavaClassInfo
-
getRelativeName
- Specified by:
getRelativeName
in interfaceIJavaClassInfo
-
getDisplayName
- Specified by:
getDisplayName
in interfaceIJavaClassInfo
-
getSimpleName
- Specified by:
getSimpleName
in interfaceIJavaClassType
-
isVisibleViaFeatureDescriptor
- Specified by:
isVisibleViaFeatureDescriptor
in interfaceIJavaClassInfo
-
isHiddenViaFeatureDescriptor
public boolean isHiddenViaFeatureDescriptor()- Specified by:
isHiddenViaFeatureDescriptor
in interfaceIJavaClassInfo
-
getFields
- Specified by:
getFields
in interfaceIJavaClassInfo
-
getAsmType
- Specified by:
getAsmType
in interfaceIAsmJavaClassInfo
-
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
- Specified by:
getEnclosingClass
in interfaceIJavaAnnotatedElement
- Specified by:
getEnclosingClass
in classJavaSourceElement
-
getDeclaringClass
- Overrides:
getDeclaringClass
in classJavaSourceElement
-
getEnclosingType
- Specified by:
getEnclosingType
in interfaceIJavaClassInfo
-
getNamespace
- Specified by:
getNamespace
in interfaceIJavaClassType
- Overrides:
getNamespace
in classAsmTypeJavaClassType
-
getGenericInterfaces
- Specified by:
getGenericInterfaces
in interfaceIJavaClassInfo
-
getGenericSuperclass
- Specified by:
getGenericSuperclass
in interfaceIJavaClassInfo
-
getArrayType
- Specified by:
getArrayType
in interfaceIJavaClassInfo
-
getDeclaredClasses
- Specified by:
getDeclaredClasses
in interfaceIJavaClassInfo
-
isAssignableFrom
- 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
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
-
toString
-
getBackingClass
- Specified by:
getBackingClass
in interfaceIJavaClassInfo
-
getSourceFileHandle
- Specified by:
getSourceFileHandle
in interfaceIJavaClassInfo
-
findSourceFile
-
makeClassFileName
-
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
-
findSourceClass
-
getModule
- Specified by:
getModule
in interfaceIJavaClassType
- Specified by:
getModule
in interfaceITypeInfoResolver
- Overrides:
getModule
in classAsmTypeJavaClassType
-
resolveType
- Specified by:
resolveType
in interfaceITypeInfoResolver
-
getDeepestClassAtOffset
- Specified by:
getDeepestClassAtOffset
in interfaceIJavaClassInfo
-
resolveType
- Specified by:
resolveType
in interfaceITypeInfoResolver
-
resolveImport
- Specified by:
resolveImport
in interfaceITypeInfoResolver
-