Package gw.internal.gosu.parser
Class ClassJavaClassInfo
- java.lang.Object
-
- gw.internal.gosu.parser.TypeJavaClassType
-
- gw.internal.gosu.parser.ClassJavaClassInfo
-
- All Implemented Interfaces:
IClassJavaClassInfo,IJavaAnnotatedElement,IJavaClassInfo,IJavaClassType,ITypeInfoResolver,java.io.Serializable
public class ClassJavaClassInfo extends TypeJavaClassType implements IClassJavaClassInfo
- 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 java.lang.Boolean_bArrayprivate java.lang.Boolean_bEnumprivate java.lang.Boolean_bInterfaceprivate java.lang.Class<?>_classprivate IAnnotationInfo[]_declaredAnnotationsprivate IJavaClassInfo[]_declaredClassesprivate IJavaClassConstructor[]_declaredConstructorsprivate IJavaClassField[]_declaredFieldsprivate IJavaClassMethod[]_declaredMethodsprivate LocklessLazyVar<IType>_enclosingClassprivate IJavaClassField[]_fieldsprivate ISourceFileHandle_fileHandleprivate IJavaClassType[]_genericInterfacesprivate IJavaClassInfo[]_interfacesprivate IType_javaTypeprivate IJavaMethodDescriptor[]_methodDescriptorsprivate java.lang.Integer_modifiersprivate java.lang.String_namespaceprivate IJavaPropertyDescriptor[]_propertyDescriptorsprivate IJavaClassInfo_superclassprivate IJavaClassTypeVariable[]_typeVariables-
Fields inherited from class gw.internal.gosu.parser.TypeJavaClassType
_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 ClassJavaClassInfo(java.lang.Class 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.IAnnotationInfogetAnnotation(java.lang.Class annotationClass)Returns this element's annotation for the specified type if such an annotation is present, else null.IJavaClassInfogetArrayType()java.lang.ClassgetBackingClass()private intgetCachedModifiers()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()java.lang.StringgetDisplayName()IJavaClassInfogetEnclosingClass()ITypegetEnclosingType()java.lang.Object[]getEnumConstants()IJavaClassField[]getFields()IJavaClassType[]getGenericInterfaces()IJavaClassTypegetGenericSuperclass()IJavaClassInfo[]getInterfaces()java.lang.ClassgetJavaClass()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()IJavaClassInfogetSuperclass()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()booleanisTypeGosuClassInstance()booleanisVisibleViaFeatureDescriptor(IScriptabilityModifier constraint)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(IType javaType)voidsetSourceFileHandle(ISourceFileHandle fileHandle)java.lang.StringtoString()-
Methods inherited from class gw.internal.gosu.parser.TypeJavaClassType
createType, createType, getActualType, getActualType
-
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, getDeepestClassAtOffset, getField, isCompilable
-
Methods inherited from interface gw.lang.reflect.java.IJavaClassType
getActualType, getActualType, isAssignableFrom
-
-
-
-
Field Detail
-
_class
private java.lang.Class<?> _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
-
_fields
private IJavaClassField[] _fields
-
_genericInterfaces
private IJavaClassType[] _genericInterfaces
-
_declaredClasses
private IJavaClassInfo[] _declaredClasses
-
_fileHandle
private ISourceFileHandle _fileHandle
-
_javaType
private IType _javaType
-
_namespace
private java.lang.String _namespace
-
_modifiers
private volatile java.lang.Integer _modifiers
-
_bArray
private java.lang.Boolean _bArray
-
_bEnum
private java.lang.Boolean _bEnum
-
_bInterface
private java.lang.Boolean _bInterface
-
_enclosingClass
private LocklessLazyVar<IType> _enclosingClass
-
-
Constructor Detail
-
ClassJavaClassInfo
public ClassJavaClassInfo(java.lang.Class cls, IModule module)
-
-
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 classTypeJavaClassType
-
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(IType 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
-
getJavaClass
public java.lang.Class getJavaClass()
- Specified by:
getJavaClassin interfaceIClassJavaClassInfo
-
getComponentType
public IJavaClassInfo getComponentType()
- Specified by:
getComponentTypein interfaceIJavaClassInfo- Specified by:
getComponentTypein interfaceIJavaClassType- Overrides:
getComponentTypein classTypeJavaClassType
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceIJavaClassInfo- Specified by:
isArrayin interfaceIJavaClassType- Overrides:
isArrayin classTypeJavaClassType
-
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
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingTypein interfaceIJavaClassInfo
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceIJavaClassType- Overrides:
getNamespacein classTypeJavaClassType
-
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
-
getCachedModifiers
private int getCachedModifiers()
-
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 classTypeJavaClassType- 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 classTypeJavaClassType- 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
-
getModule
public IModule getModule()
- Specified by:
getModulein interfaceIJavaClassType- Specified by:
getModulein interfaceITypeInfoResolver- Overrides:
getModulein classTypeJavaClassType
-
isTypeGosuClassInstance
public boolean isTypeGosuClassInstance()
- Specified by:
isTypeGosuClassInstancein interfaceIClassJavaClassInfo
-
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
-
setSourceFileHandle
public void setSourceFileHandle(ISourceFileHandle fileHandle)
-
-