Package gw.internal.gosu.parser
Class JavaEnumType
- java.lang.Object
-
- gw.lang.reflect.AbstractType
-
- gw.lang.reflect.InnerClassCapableType
-
- gw.internal.gosu.parser.JavaEnumType
-
- All Implemented Interfaces:
IJavaEnumTypeInternal
,IJavaTypeInternal
,IParameterizableType
,IFileRepositoryBasedType
,IHasInnerClass
,ICanBeAnnotation
,IDefaultArrayType
,IEnhanceableType
,IEnumData
,IEnumType
,IHasJavaClass
,IType
,IJavaArrayType
,IJavaBackedType
,IJavaBackedTypeData
,IJavaEnumType
,IJavaType
,Serializable
public class JavaEnumType extends InnerClassCapableType implements IJavaEnumTypeInternal, IJavaEnumType
Provides an implementation of IEnumeratedType for java enums- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected IJavaClassInfo
_classInfo
-
Fields inherited from interface gw.internal.gosu.parser.IJavaTypeInternal
TYPES_BY_CLASS
-
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
-
Constructor Summary
Constructors Constructor Description JavaEnumType(IJavaClassInfo cls, DefaultTypeLoader loader)
JavaEnumType(Class cls, DefaultTypeLoader loader)
-
Method Summary
-
Methods inherited from class gw.lang.reflect.InnerClassCapableType
resolveRelativeInnerClass
-
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.ICanBeAnnotation
isAnnotation
-
Methods inherited from interface gw.lang.reflect.IDefaultArrayType
getConcreteClass
-
Methods inherited from interface gw.lang.parser.IFileRepositoryBasedType
getClassType, getJavaName, getSourceFileHandle
-
Methods inherited from interface gw.lang.parser.IHasInnerClass
getInnerClass, getLoadedInnerClasses, resolveRelativeInnerClass
-
Methods inherited from interface gw.lang.reflect.IHasJavaClass
getBackingClass
-
Methods inherited from interface gw.lang.reflect.java.IJavaBackedType
getTypeFromJavaBackedType
-
Methods inherited from interface gw.lang.reflect.java.IJavaType
createAdapterClass, getBackingClassInfo, getGenericType, getInnerClasses, getIntrinsicClass, getRetainedMemory
-
Methods inherited from interface gw.internal.gosu.parser.IJavaTypeInternal
assignGenericTypeVariables, getAdapterClass, getAdapterClassDirectly, getExplicitTypeInfo, getSimpleName, getTypeInfoChecksum, hasAncestorBeenUpdated, isDefiningGenericTypes, setAdapterClass, setComponentType, writeReplace
-
Methods inherited from interface gw.internal.gosu.parser.IParameterizableType
getLoaderParameterizedTypes, isStrictGenerics
-
Methods inherited from interface gw.lang.reflect.IType
compile, getAllTypesInHierarchy, getArrayComponent, getArrayLength, getArrayType, getComponentType, getCompoundTypeComponents, getDisplayName, getEnclosingType, getFunctionalInterface, getGenericTypeVariables, getInterfaces, getLiteralMetaType, getMetaType, getModifiers, getName, getNamespace, getParameterizedType, getRelativeName, getSourceFiles, getSupertype, getTypeInfo, getTypeLoader, getTypeParameters, isAbstract, isArray, isAssignableFrom, isCompilable, isCompoundType, isDiscarded, isDynamic, isEnum, isFinal, isGenericType, isInterface, isMutable, isParameterizedType, isPrimitive, isValid, makeArrayInstance, readResolve, setArrayComponent, setDiscarded, unloadTypeInfo
-
-
-
-
Field Detail
-
_classInfo
protected transient IJavaClassInfo _classInfo
-
-
Constructor Detail
-
JavaEnumType
public JavaEnumType(Class cls, DefaultTypeLoader loader)
-
JavaEnumType
public JavaEnumType(IJavaClassInfo cls, DefaultTypeLoader loader)
-
-
Method Detail
-
getEnumType
public IType getEnumType()
- Specified by:
getEnumType
in interfaceIJavaEnumTypeInternal
-
getEnumConstants
public List<String> getEnumConstants()
- Specified by:
getEnumConstants
in interfaceIEnumData
-
getEnumValues
public List<IEnumValue> getEnumValues()
- Specified by:
getEnumValues
in interfaceIEnumData
-
getEnumValue
public IEnumValue getEnumValue(String strName)
- Specified by:
getEnumValue
in interfaceIEnumData
-
get
public static IJavaTypeInternal get(Class cls, DefaultTypeLoader loader)
-
create
public static IJavaTypeInternal create(IJavaClassInfo cls, DefaultTypeLoader loader)
-
isDefiningGenericTypes
public boolean isDefiningGenericTypes()
- Specified by:
isDefiningGenericTypes
in interfaceIJavaTypeInternal
-
assignGenericTypeVariables
public GenericTypeVariable[] assignGenericTypeVariables()
- Specified by:
assignGenericTypeVariables
in interfaceIJavaTypeInternal
-
getTypeLoader
public DefaultTypeLoader getTypeLoader()
- Specified by:
getTypeLoader
in interfaceIType
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceIType
-
getRelativeName
public String getRelativeName()
- Specified by:
getRelativeName
in interfaceIType
-
getSimpleName
public String getSimpleName()
- Specified by:
getSimpleName
in interfaceIJavaTypeInternal
-
getNamespace
public String getNamespace()
- Specified by:
getNamespace
in interfaceIType
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in interfaceIType
-
makeArrayInstance
public Object makeArrayInstance(int iLength)
- Specified by:
makeArrayInstance
in interfaceIType
-
isAssignableFrom
public boolean isAssignableFrom(IType type)
- Specified by:
isAssignableFrom
in interfaceIType
-
isMutable
public boolean isMutable()
Note eventhough some classes are indeed immutable (e.g. java.lang.String) there's no such info in a java class, so we default to mutable.
-
getIntrinsicClass
public Class getIntrinsicClass()
- Specified by:
getIntrinsicClass
in interfaceIJavaType
-
getBackingClassInfo
public IJavaClassInfo getBackingClassInfo()
- Specified by:
getBackingClassInfo
in interfaceIJavaBackedTypeData
- Specified by:
getBackingClassInfo
in interfaceIJavaType
-
getBackingClass
public Class getBackingClass()
- Specified by:
getBackingClass
in interfaceIHasJavaClass
-
getTypeInfo
public ITypeInfo getTypeInfo()
- Specified by:
getTypeInfo
in interfaceIType
-
getAdapterClass
public IGosuClassInternal getAdapterClass()
- Specified by:
getAdapterClass
in interfaceIJavaType
- Specified by:
getAdapterClass
in interfaceIJavaTypeInternal
-
getAdapterClassDirectly
public IGosuClassInternal getAdapterClassDirectly()
- Specified by:
getAdapterClassDirectly
in interfaceIJavaTypeInternal
-
unloadTypeInfo
public void unloadTypeInfo()
- Specified by:
unloadTypeInfo
in interfaceIType
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in interfaceIType
-
getInterfaces
public IType[] getInterfaces()
- Specified by:
getInterfaces
in interfaceIType
-
getSupertype
public IType getSupertype()
- Specified by:
getSupertype
in interfaceIType
-
getInnerClasses
public List<IJavaType> getInnerClasses()
- Specified by:
getInnerClasses
in interfaceIHasInnerClass
- Specified by:
getInnerClasses
in interfaceIJavaType
-
getInnerClass
public IType getInnerClass(CharSequence name)
- Specified by:
getInnerClass
in interfaceIHasInnerClass
-
getSourceFileHandle
public ISourceFileHandle getSourceFileHandle()
- Specified by:
getSourceFileHandle
in interfaceIFileRepositoryBasedType
-
getLoadedInnerClasses
public List<? extends IType> getLoadedInnerClasses()
- Specified by:
getLoadedInnerClasses
in interfaceIHasInnerClass
-
getClassType
public ClassType getClassType()
- Specified by:
getClassType
in interfaceIFileRepositoryBasedType
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingType
in interfaceIType
-
getGenericType
public IJavaTypeInternal getGenericType()
- Specified by:
getGenericType
in interfaceIJavaType
- Specified by:
getGenericType
in interfaceIType
-
isParameterizedType
public boolean isParameterizedType()
- Specified by:
isParameterizedType
in interfaceIType
-
isGenericType
public boolean isGenericType()
- Specified by:
isGenericType
in interfaceIType
-
getGenericTypeVariables
public GenericTypeVariable[] getGenericTypeVariables()
- Specified by:
getGenericTypeVariables
in interfaceIType
-
getTypeParameters
public IType[] getTypeParameters()
- Specified by:
getTypeParameters
in interfaceIType
-
getParameterizedType
public IType getParameterizedType(IType... paramTypes)
- Specified by:
getParameterizedType
in interfaceIType
-
getAllTypesInHierarchy
public Set<IType> getAllTypesInHierarchy()
- Specified by:
getAllTypesInHierarchy
in interfaceIType
-
getArrayType
public IType getArrayType()
- Specified by:
getArrayType
in interfaceIType
-
getArrayComponent
public Object getArrayComponent(Object array, int iIndex) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
- Specified by:
getArrayComponent
in interfaceIType
- Throws:
IllegalArgumentException
ArrayIndexOutOfBoundsException
-
setArrayComponent
public void setArrayComponent(Object array, int iIndex, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
- Specified by:
setArrayComponent
in interfaceIType
- Throws:
IllegalArgumentException
ArrayIndexOutOfBoundsException
-
getArrayLength
public int getArrayLength(Object array) throws IllegalArgumentException
- Specified by:
getArrayLength
in interfaceIType
- Throws:
IllegalArgumentException
-
getComponentType
public IJavaTypeInternal getComponentType()
- Specified by:
getComponentType
in interfaceIType
-
setComponentType
public void setComponentType(IJavaTypeInternal componentType)
- Specified by:
setComponentType
in interfaceIJavaTypeInternal
-
getTypeInfoChecksum
public int getTypeInfoChecksum()
- Specified by:
getTypeInfoChecksum
in interfaceIJavaTypeInternal
-
hasAncestorBeenUpdated
public boolean hasAncestorBeenUpdated()
- Specified by:
hasAncestorBeenUpdated
in interfaceIJavaTypeInternal
-
hasBeenUpdated
public static boolean hasBeenUpdated(IJavaTypeInternal type, int tiChecksum, Set<IType> visited)
-
writeReplace
public Object writeReplace()
- Specified by:
writeReplace
in interfaceIJavaTypeInternal
-
readResolve
public Object readResolve() throws ObjectStreamException
- Specified by:
readResolve
in interfaceIType
- Throws:
ObjectStreamException
-
getModifiers
public int getModifiers()
- Specified by:
getModifiers
in interfaceIType
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceIType
-
getExplicitTypeInfo
public ITypeInfo getExplicitTypeInfo()
- Specified by:
getExplicitTypeInfo
in interfaceIJavaTypeInternal
-
setAdapterClass
public void setAdapterClass(IGosuClassInternal adapterClass)
- Specified by:
setAdapterClass
in interfaceIJavaTypeInternal
-
createAdapterClass
public IGosuClassInternal createAdapterClass()
- Specified by:
createAdapterClass
in interfaceIJavaType
-
unloadTypes
public static void unloadTypes()
-
isDiscarded
public boolean isDiscarded()
- Specified by:
isDiscarded
in interfaceIType
-
setDiscarded
public void setDiscarded(boolean bDiscarded)
- Specified by:
setDiscarded
in interfaceIType
-
isCompoundType
public boolean isCompoundType()
- Specified by:
isCompoundType
in interfaceIType
-
getCompoundTypeComponents
public Set<IType> getCompoundTypeComponents()
- Specified by:
getCompoundTypeComponents
in interfaceIType
-
getConcreteClass
public IJavaClassInfo getConcreteClass()
- Specified by:
getConcreteClass
in interfaceIDefaultArrayType
-
getTypeFromJavaBackedType
public IType getTypeFromJavaBackedType()
- Specified by:
getTypeFromJavaBackedType
in interfaceIJavaBackedType
-
getRetainedMemory
public ObjectSize getRetainedMemory()
- Specified by:
getRetainedMemory
in interfaceIJavaType
-
getLoaderParameterizedTypes
public IType[] getLoaderParameterizedTypes()
- Specified by:
getLoaderParameterizedTypes
in interfaceIParameterizableType
-
isStrictGenerics
public boolean isStrictGenerics()
- Specified by:
isStrictGenerics
in interfaceIParameterizableType
-
getSourceFiles
public IFile[] getSourceFiles()
- Specified by:
getSourceFiles
in interfaceIType
-
isAnnotation
public boolean isAnnotation()
- Specified by:
isAnnotation
in interfaceICanBeAnnotation
-
getFunctionalInterface
public IFunctionType getFunctionalInterface()
- Specified by:
getFunctionalInterface
in interfaceIType
-
getTheRef
protected IType getTheRef()
- Overrides:
getTheRef
in classAbstractType
-
isCompilable
public boolean isCompilable()
- Specified by:
isCompilable
in interfaceIType
-
-