Package com.strobel.assembler.metadata
Class TypeDefinition
- java.lang.Object
-
- com.strobel.assembler.metadata.MemberReference
-
- com.strobel.assembler.metadata.TypeReference
-
- com.strobel.assembler.metadata.TypeDefinition
-
- All Implemented Interfaces:
IAnnotationsProvider
,IGenericContext
,IGenericParameterProvider
,IMemberDefinition
,IMetadataTypeMember
- Direct Known Subclasses:
BottomType
,CompoundTypeDefinition
,GenericParameter
,InvokeDynamicRewriter.IndyHelperBuilder.HelperTypeDefinition
,MethodHandleConstantRewriter.LcdMHHelperBuilder.HelperTypeDefinition
,NullType
,PrimitiveType
,RecordTypeDefinition
public class TypeDefinition extends TypeReference implements IMemberDefinition
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.strobel.assembler.metadata.TypeReference
TypeReference.TypeFunctions
-
-
Field Summary
-
Fields inherited from class com.strobel.assembler.metadata.TypeReference
EMPTY_REFERENCES
-
-
Constructor Summary
Constructors Constructor Description TypeDefinition()
TypeDefinition(IMetadataResolver resolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(TypeMetadataVisitor<P,R> visitor, P parameter)
protected java.lang.StringBuilder
appendDescription(java.lang.StringBuilder sb)
protected java.lang.StringBuilder
appendGenericSignature(java.lang.StringBuilder sb)
protected java.lang.StringBuilder
appendName(java.lang.StringBuilder sb, boolean fullName, boolean dottedName)
GenericParameter
findTypeVariable(java.lang.String name)
java.util.List<CustomAnnotation>
getAnnotations()
protected Collection<CustomAnnotation>
getAnnotationsInternal()
TypeReference
getBaseType()
int
getCompilerMajorVersion()
int
getCompilerMinorVersion()
CompilerTarget
getCompilerTarget()
ConstantPool
getConstantPool()
java.util.List<FieldDefinition>
getDeclaredFields()
protected Collection<FieldDefinition>
getDeclaredFieldsInternal()
java.util.List<MethodDefinition>
getDeclaredMethods()
protected Collection<MethodDefinition>
getDeclaredMethodsInternal()
java.util.List<TypeDefinition>
getDeclaredTypes()
protected Collection<TypeDefinition>
getDeclaredTypesInternal()
MethodReference
getDeclaringMethod()
java.util.List<java.lang.Enum>
getEnumConstants()
java.lang.String
getErasedSignature()
Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.java.util.List<TypeReference>
getExplicitInterfaces()
protected Collection<TypeReference>
getExplicitInterfacesInternal()
long
getFlags()
java.lang.String
getFullName()
java.util.List<GenericParameter>
getGenericParameters()
protected GenericParameterCollection
getGenericParametersInternal()
java.lang.String
getInternalName()
int
getModifiers()
java.lang.String
getPackageName()
java.util.List<TypeReference>
getPermittedSubclasses()
protected Collection<TypeReference>
getPermittedSubclassesInternal()
TypeReference
getRawType()
IMetadataResolver
getResolver()
java.lang.String
getSignature()
Method that returns full generic signature of a type or member.java.lang.String
getSimpleName()
JvmType
getSimpleType()
java.util.List<SourceAttribute>
getSourceAttributes()
protected Collection<SourceAttribute>
getSourceAttributesInternal()
(package private) ITypeLoader
getTypeLoader()
boolean
isAnnotation()
boolean
isAnonymous()
boolean
isArray()
boolean
isClass()
boolean
isCompoundType()
boolean
isDefinition()
boolean
isDeprecated()
boolean
isEnum()
boolean
isFinal()
boolean
isInnerClass()
boolean
isInterface()
boolean
isLocalClass()
boolean
isModule()
boolean
isNested()
boolean
isNonPublic()
boolean
isNonSealed()
boolean
isPackagePrivate()
boolean
isPrimitive()
boolean
isPrivate()
boolean
isProtected()
boolean
isPublic()
boolean
isRecord()
boolean
isSealed()
boolean
isStatic()
boolean
isSynthetic()
TypeDefinition
resolve()
protected void
setBaseType(TypeReference baseType)
protected void
setCompilerVersion(int majorVersion, int minorVersion)
protected void
setConstantPool(ConstantPool constantPool)
protected void
setDeclaringMethod(MethodReference declaringMethod)
protected void
setEnumConstants(java.lang.Enum... values)
protected void
setFlags(long flags)
protected void
setPackageName(java.lang.String packageName)
protected void
setResolver(IMetadataResolver resolver)
protected void
setSimpleName(java.lang.String simpleName)
(package private) void
setTypeLoader(ITypeLoader typeLoader)
-
Methods inherited from class com.strobel.assembler.metadata.TypeReference
appendBriefDescription, appendClassDescription, appendClassSignature, appendErasedClassSignature, appendErasedDescription, appendErasedSignature, appendSignature, appendSimpleDescription, checkRecursive, containsGenericParameters, equals, getBriefDescription, getDeclaringType, getDescription, getElementType, getErasedDescription, getExtendsBound, getName, getSimpleDescription, getSuperBound, getUnderlyingType, hasExtendsBound, hasGenericParameters, hashCode, hasSuperBound, isBoundedType, isEquivalentTo, isGenericDefinition, isGenericParameter, isGenericType, isUnbounded, isUnionType, isVoid, isWildcardType, makeArrayType, makeGenericType, makeGenericType, resolve, resolve, resolve, setDeclaringType, setName, toString
-
Methods inherited from class com.strobel.assembler.metadata.MemberReference
hasAnnotations, isSpecialName
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.strobel.assembler.metadata.IMemberDefinition
getBriefDescription, getDeclaringType, getDescription, getErasedDescription, getName, getSimpleDescription, isSpecialName
-
-
-
-
Field Detail
-
_genericParameters
private final GenericParameterCollection _genericParameters
-
_declaredTypes
private final Collection<TypeDefinition> _declaredTypes
-
_declaredFields
private final Collection<FieldDefinition> _declaredFields
-
_declaredMethods
private final Collection<MethodDefinition> _declaredMethods
-
_explicitInterfaces
private final Collection<TypeReference> _explicitInterfaces
-
_permittedSubclasses
private final Collection<TypeReference> _permittedSubclasses
-
_customAnnotations
private final Collection<CustomAnnotation> _customAnnotations
-
_sourceAttributes
private final Collection<SourceAttribute> _sourceAttributes
-
_genericParametersView
private final java.util.List<GenericParameter> _genericParametersView
-
_declaredTypesView
private final java.util.List<TypeDefinition> _declaredTypesView
-
_declaredFieldsView
private final java.util.List<FieldDefinition> _declaredFieldsView
-
_declaredMethodsView
private final java.util.List<MethodDefinition> _declaredMethodsView
-
_explicitInterfacesView
private final java.util.List<TypeReference> _explicitInterfacesView
-
_permittedSubclassesView
private final java.util.List<TypeReference> _permittedSubclassesView
-
_customAnnotationsView
private final java.util.List<CustomAnnotation> _customAnnotationsView
-
_sourceAttributesView
private final java.util.List<SourceAttribute> _sourceAttributesView
-
_resolver
private IMetadataResolver _resolver
-
_simpleName
private java.lang.String _simpleName
-
_packageName
private java.lang.String _packageName
-
_internalName
private java.lang.String _internalName
-
_fullName
private java.lang.String _fullName
-
_signature
private java.lang.String _signature
-
_erasedSignature
private java.lang.String _erasedSignature
-
_baseType
private TypeReference _baseType
-
_flags
private long _flags
-
_compilerVersion
private int _compilerVersion
-
_enumConstants
private java.util.List<java.lang.Enum> _enumConstants
-
_rawType
private TypeReference _rawType
-
_declaringMethod
private MethodReference _declaringMethod
-
_constantPool
private ConstantPool _constantPool
-
_typeLoader
private ITypeLoader _typeLoader
-
-
Constructor Detail
-
TypeDefinition
public TypeDefinition()
-
TypeDefinition
public TypeDefinition(IMetadataResolver resolver)
-
-
Method Detail
-
getTypeLoader
final ITypeLoader getTypeLoader()
-
setTypeLoader
final void setTypeLoader(ITypeLoader typeLoader)
-
getCompilerTarget
public final CompilerTarget getCompilerTarget()
-
getCompilerMajorVersion
public final int getCompilerMajorVersion()
-
getCompilerMinorVersion
public final int getCompilerMinorVersion()
-
getConstantPool
public final ConstantPool getConstantPool()
-
setConstantPool
protected final void setConstantPool(ConstantPool constantPool)
-
setCompilerVersion
protected final void setCompilerVersion(int majorVersion, int minorVersion)
-
getResolver
public final IMetadataResolver getResolver()
-
setResolver
protected final void setResolver(IMetadataResolver resolver)
-
getPackageName
public java.lang.String getPackageName()
- Overrides:
getPackageName
in classTypeReference
-
getSimpleName
public java.lang.String getSimpleName()
- Specified by:
getSimpleName
in classTypeReference
-
setSimpleName
protected final void setSimpleName(java.lang.String simpleName)
-
setPackageName
protected void setPackageName(java.lang.String packageName)
-
getFullName
public java.lang.String getFullName()
- Specified by:
getFullName
in interfaceIMemberDefinition
- Overrides:
getFullName
in classTypeReference
-
getErasedSignature
public java.lang.String getErasedSignature()
Description copied from class:MemberReference
Method that returns type erased signature of a type or member; suitable as non-generic signature some packages need.- Overrides:
getErasedSignature
in classMemberReference
-
getSignature
public java.lang.String getSignature()
Description copied from class:MemberReference
Method that returns full generic signature of a type or member.- Overrides:
getSignature
in classMemberReference
-
getInternalName
public java.lang.String getInternalName()
- Overrides:
getInternalName
in classTypeReference
-
accept
public <R,P> R accept(TypeMetadataVisitor<P,R> visitor, P parameter)
- Specified by:
accept
in classTypeReference
-
getDeclaringMethod
public final MethodReference getDeclaringMethod()
-
setDeclaringMethod
protected final void setDeclaringMethod(MethodReference declaringMethod)
-
getBaseType
public final TypeReference getBaseType()
-
setBaseType
protected final void setBaseType(TypeReference baseType)
-
getEnumConstants
public final java.util.List<java.lang.Enum> getEnumConstants()
-
setEnumConstants
protected final void setEnumConstants(java.lang.Enum... values)
-
getExplicitInterfaces
public final java.util.List<TypeReference> getExplicitInterfaces()
-
getPermittedSubclasses
public final java.util.List<TypeReference> getPermittedSubclasses()
-
getAnnotations
public final java.util.List<CustomAnnotation> getAnnotations()
- Specified by:
getAnnotations
in interfaceIAnnotationsProvider
- Overrides:
getAnnotations
in classMemberReference
-
getSourceAttributes
public final java.util.List<SourceAttribute> getSourceAttributes()
-
getGenericParameters
public final java.util.List<GenericParameter> getGenericParameters()
- Specified by:
getGenericParameters
in interfaceIGenericParameterProvider
- Overrides:
getGenericParameters
in classTypeReference
-
getRawType
public TypeReference getRawType()
- Overrides:
getRawType
in classTypeReference
-
findTypeVariable
public GenericParameter findTypeVariable(java.lang.String name)
- Specified by:
findTypeVariable
in interfaceIGenericContext
- Overrides:
findTypeVariable
in classTypeReference
-
appendName
protected java.lang.StringBuilder appendName(java.lang.StringBuilder sb, boolean fullName, boolean dottedName)
- Overrides:
appendName
in classTypeReference
-
getGenericParametersInternal
protected final GenericParameterCollection getGenericParametersInternal()
-
getDeclaredTypesInternal
protected final Collection<TypeDefinition> getDeclaredTypesInternal()
-
getDeclaredFieldsInternal
protected final Collection<FieldDefinition> getDeclaredFieldsInternal()
-
getDeclaredMethodsInternal
protected final Collection<MethodDefinition> getDeclaredMethodsInternal()
-
getExplicitInterfacesInternal
protected final Collection<TypeReference> getExplicitInterfacesInternal()
-
getPermittedSubclassesInternal
protected final Collection<TypeReference> getPermittedSubclassesInternal()
-
getAnnotationsInternal
protected final Collection<CustomAnnotation> getAnnotationsInternal()
-
getSourceAttributesInternal
protected final Collection<SourceAttribute> getSourceAttributesInternal()
-
resolve
public TypeDefinition resolve()
- Overrides:
resolve
in classTypeReference
-
getFlags
public final long getFlags()
- Specified by:
getFlags
in interfaceIMemberDefinition
-
setFlags
protected final void setFlags(long flags)
-
getModifiers
public final int getModifiers()
- Specified by:
getModifiers
in interfaceIMemberDefinition
-
isFinal
public final boolean isFinal()
- Specified by:
isFinal
in interfaceIMemberDefinition
-
isNonPublic
public final boolean isNonPublic()
- Specified by:
isNonPublic
in interfaceIMemberDefinition
-
isPrivate
public final boolean isPrivate()
- Specified by:
isPrivate
in interfaceIMemberDefinition
-
isProtected
public final boolean isProtected()
- Specified by:
isProtected
in interfaceIMemberDefinition
-
isPublic
public final boolean isPublic()
- Specified by:
isPublic
in interfaceIMemberDefinition
-
isStatic
public final boolean isStatic()
- Specified by:
isStatic
in interfaceIMemberDefinition
-
isSealed
public final boolean isSealed()
-
isNonSealed
public final boolean isNonSealed()
-
isSynthetic
public final boolean isSynthetic()
- Specified by:
isSynthetic
in interfaceIMemberDefinition
-
isDeprecated
public final boolean isDeprecated()
- Specified by:
isDeprecated
in interfaceIMemberDefinition
-
isPackagePrivate
public final boolean isPackagePrivate()
- Specified by:
isPackagePrivate
in interfaceIMemberDefinition
-
getSimpleType
public JvmType getSimpleType()
- Overrides:
getSimpleType
in classTypeReference
-
isAnnotation
public final boolean isAnnotation()
-
isClass
public final boolean isClass()
-
isInterface
public final boolean isInterface()
-
isEnum
public final boolean isEnum()
-
isRecord
public final boolean isRecord()
-
isModule
public final boolean isModule()
-
isAnonymous
public final boolean isAnonymous()
-
isInnerClass
public final boolean isInnerClass()
-
isLocalClass
public final boolean isLocalClass()
-
isNested
public boolean isNested()
- Overrides:
isNested
in classTypeReference
-
isArray
public boolean isArray()
- Overrides:
isArray
in classTypeReference
-
isPrimitive
public boolean isPrimitive()
- Overrides:
isPrimitive
in classTypeReference
-
isDefinition
public final boolean isDefinition()
- Overrides:
isDefinition
in classMemberReference
-
getDeclaredFields
public final java.util.List<FieldDefinition> getDeclaredFields()
-
getDeclaredMethods
public final java.util.List<MethodDefinition> getDeclaredMethods()
-
getDeclaredTypes
public final java.util.List<TypeDefinition> getDeclaredTypes()
-
isCompoundType
public boolean isCompoundType()
- Overrides:
isCompoundType
in classTypeReference
-
appendDescription
protected java.lang.StringBuilder appendDescription(java.lang.StringBuilder sb)
- Overrides:
appendDescription
in classTypeReference
-
appendGenericSignature
protected java.lang.StringBuilder appendGenericSignature(java.lang.StringBuilder sb)
- Overrides:
appendGenericSignature
in classTypeReference
-
-