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:
getEnumTypein interfaceIJavaEnumTypeInternal
-
getEnumConstants
public List<String> getEnumConstants()
- Specified by:
getEnumConstantsin interfaceIEnumData
-
getEnumValues
public List<IEnumValue> getEnumValues()
- Specified by:
getEnumValuesin interfaceIEnumData
-
getEnumValue
public IEnumValue getEnumValue(String strName)
- Specified by:
getEnumValuein 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:
isDefiningGenericTypesin interfaceIJavaTypeInternal
-
assignGenericTypeVariables
public GenericTypeVariable[] assignGenericTypeVariables()
- Specified by:
assignGenericTypeVariablesin interfaceIJavaTypeInternal
-
getTypeLoader
public DefaultTypeLoader getTypeLoader()
- Specified by:
getTypeLoaderin interfaceIType
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceIType
-
getRelativeName
public String getRelativeName()
- Specified by:
getRelativeNamein interfaceIType
-
getSimpleName
public String getSimpleName()
- Specified by:
getSimpleNamein interfaceIJavaTypeInternal
-
getNamespace
public String getNamespace()
- Specified by:
getNamespacein interfaceIType
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfaceIType
-
makeArrayInstance
public Object makeArrayInstance(int iLength)
- Specified by:
makeArrayInstancein interfaceIType
-
isAssignableFrom
public boolean isAssignableFrom(IType type)
- Specified by:
isAssignableFromin 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:
getIntrinsicClassin interfaceIJavaType
-
getBackingClassInfo
public IJavaClassInfo getBackingClassInfo()
- Specified by:
getBackingClassInfoin interfaceIJavaBackedTypeData- Specified by:
getBackingClassInfoin interfaceIJavaType
-
getBackingClass
public Class getBackingClass()
- Specified by:
getBackingClassin interfaceIHasJavaClass
-
getTypeInfo
public ITypeInfo getTypeInfo()
- Specified by:
getTypeInfoin interfaceIType
-
getAdapterClass
public IGosuClassInternal getAdapterClass()
- Specified by:
getAdapterClassin interfaceIJavaType- Specified by:
getAdapterClassin interfaceIJavaTypeInternal
-
getAdapterClassDirectly
public IGosuClassInternal getAdapterClassDirectly()
- Specified by:
getAdapterClassDirectlyin interfaceIJavaTypeInternal
-
unloadTypeInfo
public void unloadTypeInfo()
- Specified by:
unloadTypeInfoin interfaceIType
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein interfaceIType
-
getInterfaces
public IType[] getInterfaces()
- Specified by:
getInterfacesin interfaceIType
-
getSupertype
public IType getSupertype()
- Specified by:
getSupertypein interfaceIType
-
getInnerClasses
public List<IJavaType> getInnerClasses()
- Specified by:
getInnerClassesin interfaceIHasInnerClass- Specified by:
getInnerClassesin interfaceIJavaType
-
getInnerClass
public IType getInnerClass(CharSequence name)
- Specified by:
getInnerClassin interfaceIHasInnerClass
-
getSourceFileHandle
public ISourceFileHandle getSourceFileHandle()
- Specified by:
getSourceFileHandlein interfaceIFileRepositoryBasedType
-
getLoadedInnerClasses
public List<? extends IType> getLoadedInnerClasses()
- Specified by:
getLoadedInnerClassesin interfaceIHasInnerClass
-
getClassType
public ClassType getClassType()
- Specified by:
getClassTypein interfaceIFileRepositoryBasedType
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingTypein interfaceIType
-
getGenericType
public IJavaTypeInternal getGenericType()
- Specified by:
getGenericTypein interfaceIJavaType- Specified by:
getGenericTypein interfaceIType
-
isParameterizedType
public boolean isParameterizedType()
- Specified by:
isParameterizedTypein interfaceIType
-
isGenericType
public boolean isGenericType()
- Specified by:
isGenericTypein interfaceIType
-
getGenericTypeVariables
public GenericTypeVariable[] getGenericTypeVariables()
- Specified by:
getGenericTypeVariablesin interfaceIType
-
getTypeParameters
public IType[] getTypeParameters()
- Specified by:
getTypeParametersin interfaceIType
-
getParameterizedType
public IType getParameterizedType(IType... paramTypes)
- Specified by:
getParameterizedTypein interfaceIType
-
getAllTypesInHierarchy
public Set<IType> getAllTypesInHierarchy()
- Specified by:
getAllTypesInHierarchyin interfaceIType
-
getArrayType
public IType getArrayType()
- Specified by:
getArrayTypein interfaceIType
-
getArrayComponent
public Object getArrayComponent(Object array, int iIndex) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
- Specified by:
getArrayComponentin interfaceIType- Throws:
IllegalArgumentExceptionArrayIndexOutOfBoundsException
-
setArrayComponent
public void setArrayComponent(Object array, int iIndex, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
- Specified by:
setArrayComponentin interfaceIType- Throws:
IllegalArgumentExceptionArrayIndexOutOfBoundsException
-
getArrayLength
public int getArrayLength(Object array) throws IllegalArgumentException
- Specified by:
getArrayLengthin interfaceIType- Throws:
IllegalArgumentException
-
getComponentType
public IJavaTypeInternal getComponentType()
- Specified by:
getComponentTypein interfaceIType
-
setComponentType
public void setComponentType(IJavaTypeInternal componentType)
- Specified by:
setComponentTypein interfaceIJavaTypeInternal
-
getTypeInfoChecksum
public int getTypeInfoChecksum()
- Specified by:
getTypeInfoChecksumin interfaceIJavaTypeInternal
-
hasAncestorBeenUpdated
public boolean hasAncestorBeenUpdated()
- Specified by:
hasAncestorBeenUpdatedin interfaceIJavaTypeInternal
-
hasBeenUpdated
public static boolean hasBeenUpdated(IJavaTypeInternal type, int tiChecksum, Set<IType> visited)
-
writeReplace
public Object writeReplace()
- Specified by:
writeReplacein interfaceIJavaTypeInternal
-
readResolve
public Object readResolve() throws ObjectStreamException
- Specified by:
readResolvein interfaceIType- Throws:
ObjectStreamException
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin interfaceIType
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceIType
-
getExplicitTypeInfo
public ITypeInfo getExplicitTypeInfo()
- Specified by:
getExplicitTypeInfoin interfaceIJavaTypeInternal
-
setAdapterClass
public void setAdapterClass(IGosuClassInternal adapterClass)
- Specified by:
setAdapterClassin interfaceIJavaTypeInternal
-
createAdapterClass
public IGosuClassInternal createAdapterClass()
- Specified by:
createAdapterClassin interfaceIJavaType
-
unloadTypes
public static void unloadTypes()
-
isDiscarded
public boolean isDiscarded()
- Specified by:
isDiscardedin interfaceIType
-
setDiscarded
public void setDiscarded(boolean bDiscarded)
- Specified by:
setDiscardedin interfaceIType
-
isCompoundType
public boolean isCompoundType()
- Specified by:
isCompoundTypein interfaceIType
-
getCompoundTypeComponents
public Set<IType> getCompoundTypeComponents()
- Specified by:
getCompoundTypeComponentsin interfaceIType
-
getConcreteClass
public IJavaClassInfo getConcreteClass()
- Specified by:
getConcreteClassin interfaceIDefaultArrayType
-
getTypeFromJavaBackedType
public IType getTypeFromJavaBackedType()
- Specified by:
getTypeFromJavaBackedTypein interfaceIJavaBackedType
-
getRetainedMemory
public ObjectSize getRetainedMemory()
- Specified by:
getRetainedMemoryin interfaceIJavaType
-
getLoaderParameterizedTypes
public IType[] getLoaderParameterizedTypes()
- Specified by:
getLoaderParameterizedTypesin interfaceIParameterizableType
-
isStrictGenerics
public boolean isStrictGenerics()
- Specified by:
isStrictGenericsin interfaceIParameterizableType
-
getSourceFiles
public IFile[] getSourceFiles()
- Specified by:
getSourceFilesin interfaceIType
-
isAnnotation
public boolean isAnnotation()
- Specified by:
isAnnotationin interfaceICanBeAnnotation
-
getFunctionalInterface
public IFunctionType getFunctionalInterface()
- Specified by:
getFunctionalInterfacein interfaceIType
-
getTheRef
protected IType getTheRef()
- Overrides:
getTheRefin classAbstractType
-
isCompilable
public boolean isCompilable()
- Specified by:
isCompilablein interfaceIType
-
-