public interface IType extends Serializable
| Modifier and Type | Field and Description |
|---|---|
static IType[] |
EMPTY_ARRAY |
static IType[] |
EMPTY_TYPE_ARRAY |
static ArrayList<IType> |
EMPTY_TYPE_LIST |
| Modifier and Type | Method and Description |
|---|---|
default byte[] |
compile() |
Set<? extends IType> |
getAllTypesInHierarchy()
Returns a Set of all IIntrinsicTypes that this class is assignable from,
including this class.
|
Object |
getArrayComponent(Object array,
int iIndex)
Returns the value of the indexed component in the specified
array object.
|
int |
getArrayLength(Object array)
Returns the length of the specified array object.
|
IType |
getArrayType()
Make an array type from this type.
|
IType |
getComponentType()
If this is an array type, a type representing the component type of the
array.
|
Set<IType> |
getCompoundTypeComponents() |
String |
getDisplayName()
The display name of this intrinsic type.
|
IType |
getEnclosingType()
Returns the type immediately enclosing this type.
|
default IFunctionType |
getFunctionalInterface() |
IType |
getGenericType()
If this is a parameterized type, returns the generic type this type
parameterizes.
|
IGenericTypeVariable[] |
getGenericTypeVariables()
Returns an array of GenericTypeVariables declared with this Generic Type.
|
IType[] |
getInterfaces() |
IMetaType |
getLiteralMetaType() |
IMetaType |
getMetaType() |
int |
getModifiers()
Returns the modifiers for this type, encoded in an integer.
|
String |
getName()
The fully qualified name of this intrinsic type.
|
String |
getNamespace()
The namespace for this class.
|
IType |
getParameterizedType(IType... ofType)
Assuming this intrinsic type is a Generic type, return the parameterized
type associated with the given list of type parameters.
|
String |
getRelativeName()
The relative or unqualified name.
|
default IFile[] |
getSourceFiles() |
IType |
getSupertype()
Returns the type representing the supertype of this type.
|
ITypeInfo |
getTypeInfo()
Get the type information for this intrinsic type.
|
ITypeLoader |
getTypeLoader()
Returns the type loader responsible for loading this intrinsic type.
|
IType[] |
getTypeParameters()
If this is a parameterized type, returns the specific types used to create
this type, null otherwies.
|
boolean |
isAbstract() |
boolean |
isArray()
True if this is an array.
|
boolean |
isAssignableFrom(IType type)
Determines if the type represented by this intrinsic type is either the
same as, or is a super-type of the type represented by the specified type
parameter.
|
default boolean |
isCompilable() |
boolean |
isCompoundType() |
boolean |
isDiscarded()
True if this type has been replaced with a newer version of the same name in the type system.
|
default boolean |
isDynamic() |
boolean |
isEnum()
Returns true if this type is an enumeration.
|
boolean |
isFinal()
True if this type cannot be extended.
|
boolean |
isGenericType()
Returns true if this ia a Generic Type.
|
boolean |
isInterface()
Returns true if this type is an interface.
|
boolean |
isMutable()
Are intances of this type mutable? Note sometimes it's difficult to
determine.
|
boolean |
isParameterizedType()
Returns true if this ia a Parameterized Type.
|
boolean |
isPrimitive()
True if this type represents a primitive type e.g., Java int, char, etc.
|
boolean |
isValid()
Defines this type if it is not yet fully defined.
|
Object |
makeArrayInstance(int iLength)
Construct an array instance of specified length.
|
Object |
readResolve()
IType requires this method be implemented to ensure IType
instances can be centrally defined and cached.
|
void |
setArrayComponent(Object array,
int iIndex,
Object value)
Sets the value of the indexed component in the specified array object.
|
void |
setDiscarded(boolean bDiscarded) |
void |
unloadTypeInfo()
Unload or nullify any references to this IType's ITypeInfo.
|
static final IType[] EMPTY_TYPE_ARRAY
static final IType[] EMPTY_ARRAY
String getName()
String getDisplayName()
getName(), but in some cases a type may want to modify it's name
for presentation to the user.String getRelativeName()
String getNamespace()
ITypeLoader getTypeLoader()
IType getSupertype()
IType getEnclosingType()
IType getGenericType()
boolean isFinal()
boolean isInterface()
default IFunctionType getFunctionalInterface()
boolean isEnum()
IType[] getInterfaces()
boolean isParameterizedType()
boolean isGenericType()
isParameterizedType()IGenericTypeVariable[] getGenericTypeVariables()
IType getParameterizedType(IType... ofType)
ofType - The type parameters.IType[] getTypeParameters()
Set<? extends IType> getAllTypesInHierarchy()
boolean isArray()
boolean isPrimitive()
IType getArrayType()
Object makeArrayInstance(int iLength)
Object getArrayComponent(Object array, int iIndex) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
array - An array instance of this intrinsic type.iIndex - The index of the component to get.NullPointerException - If the specified object is null,IllegalArgumentException - If the specified object is not an array.ArrayIndexOutOfBoundsException - If the specified index argument
is negative, or if it is greater than or equal to the length of the
specified arrayvoid setArrayComponent(Object array, int iIndex, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
array - An array instance of this intrinsic type.iIndex - The index of the component to set.value - The new value of the indexed component.NullPointerException - If the specified object is null,IllegalArgumentException - If the specified object is not an array.ArrayIndexOutOfBoundsException - If the specified index argument
is negative, or if it is greater than or equal to the length of the
specified arrayint getArrayLength(Object array) throws IllegalArgumentException
array - An array instance of this intrinsic type.IllegalArgumentException - If the object argument is not an array.IType getComponentType()
boolean isAssignableFrom(IType type)
boolean isMutable()
ITypeInfo getTypeInfo()
ITypeInfovoid unloadTypeInfo()
Object readResolve() throws ObjectStreamException
ObjectStreamExceptionboolean isValid()
int getModifiers()
public, protected,
private, final, static,
abstract they should be decoded
using the methods of class Modifier.Modifierboolean isAbstract()
boolean isDiscarded()
void setDiscarded(boolean bDiscarded)
boolean isCompoundType()
IMetaType getMetaType()
IMetaType getLiteralMetaType()
default IFile[] getSourceFiles()
default boolean isDynamic()
default boolean isCompilable()
default byte[] compile()
Copyright © 2021. All rights reserved.