Package gw.internal.gosu.parser
Class MetaType
- java.lang.Object
-
- gw.lang.reflect.AbstractType
-
- gw.internal.gosu.parser.MetaType
-
- All Implemented Interfaces:
IMetaType,INonLoadableType,IType,Serializable
public class MetaType extends AbstractType implements IMetaType
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetaType.RootType
-
Field Summary
Fields Modifier and Type Field Description static LockingLazyVar<IType>DEFAULT_TYPE_TYPEstatic LockingLazyVar<MetaType>ROOT_TYPE_TYPE-
Fields inherited from interface gw.lang.reflect.IType
EMPTY_ARRAY, EMPTY_TYPE_ARRAY, EMPTY_TYPE_LIST
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearCaches()booleanequals(Object o)static MetaTypeget(IType type)Set<? extends IType>getAllTypesInHierarchy()ObjectgetArrayComponent(Object array, int iIndex)intgetArrayLength(Object array)ITypegetArrayType()ITypegetComponentType()Set<IType>getCompoundTypeComponents()StringgetDisplayName()ITypegetEnclosingType()ITypegetGenericType()GenericTypeVariable[]getGenericTypeVariables()IType[]getInterfaces()static MetaTypegetLiteral(IType type)intgetModifiers()StringgetName()StringgetNamespace()IMetaTypegetParameterizedType(IType... ofType)StringgetRelativeName()ITypegetSupertype()ITypegetType()ITypeInfogetTypeInfo()ITypeLoadergetTypeLoader()IType[]getTypeParameters()inthashCode()booleanisAbstract()booleanisArray()booleanisAssignableFrom(IType type)MetaTypes are assignable if: they are both arrays and their component types are assignable the are not arrays and: - one of them is not a MetaType and instead implements IType - or - one of them is the DEFAULT_TYPE - or - one of them is the ROOT_TYPE - or - their core types are assignable - or - their core types are structurally assignablebooleanisCompoundType()booleanisDiscarded()booleanisEnum()booleanisFinal()booleanisGenericType()booleanisInterface()booleanisLiteral()booleanisMutable()Instance of this type (e.g., other types) are immutable.booleanisParameterizedType()booleanisPrimitive()booleanisValid()ObjectmakeArrayInstance(int iLength)ObjectreadResolve()voidsetArrayComponent(Object array, int iIndex, Object value)voidsetDiscarded(boolean bDiscarded)StringtoString()voidunloadTypeInfo()-
Methods inherited from class gw.lang.reflect.AbstractType
getLiteralMetaType, getMetaType, getTheRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.reflect.IType
compile, getFunctionalInterface, getLiteralMetaType, getMetaType, getSourceFiles, isCompilable, isDynamic
-
-
-
-
Field Detail
-
ROOT_TYPE_TYPE
public static LockingLazyVar<MetaType> ROOT_TYPE_TYPE
-
DEFAULT_TYPE_TYPE
public static LockingLazyVar<IType> DEFAULT_TYPE_TYPE
-
-
Method Detail
-
clearCaches
public static void clearCaches()
-
getTypeLoader
public ITypeLoader getTypeLoader()
- Specified by:
getTypeLoaderin interfaceIType
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayNamein interfaceIType
-
getRelativeName
public String getRelativeName()
- Specified by:
getRelativeNamein interfaceIType
-
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)
MetaTypes are assignable if:- they are both arrays and their component types are assignable
- the are not arrays and:
- - one of them is not a MetaType and instead implements IType
- - or - one of them is the DEFAULT_TYPE
- - or - one of them is the ROOT_TYPE
- - or - their core types are assignable
- - or - their core types are structurally assignable
- Specified by:
isAssignableFromin interfaceIType
-
isMutable
public boolean isMutable()
Instance of this type (e.g., other types) are immutable.
-
getTypeInfo
public ITypeInfo getTypeInfo()
- Specified by:
getTypeInfoin interfaceIType
-
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
-
getEnclosingType
public IType getEnclosingType()
- Specified by:
getEnclosingTypein interfaceIType
-
getGenericType
public IType getGenericType()
- 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 IMetaType getParameterizedType(IType... ofType)
- Specified by:
getParameterizedTypein interfaceIType
-
getAllTypesInHierarchy
public Set<? extends 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 IType getComponentType()
- Specified by:
getComponentTypein interfaceIType
-
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
-
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
-
-