org.jetbrains.kotlin.builtins
Class KotlinBuiltIns
java.lang.Object
org.jetbrains.kotlin.builtins.KotlinBuiltIns
public abstract class KotlinBuiltIns
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUILT_INS_PACKAGE_NAME
public static final Name BUILT_INS_PACKAGE_NAME
BUILT_INS_PACKAGE_FQ_NAME
public static final FqName BUILT_INS_PACKAGE_FQ_NAME
ANNOTATION_PACKAGE_FQ_NAME
public static final FqName ANNOTATION_PACKAGE_FQ_NAME
COLLECTIONS_PACKAGE_FQ_NAME
public static final FqName COLLECTIONS_PACKAGE_FQ_NAME
RANGES_PACKAGE_FQ_NAME
public static final FqName RANGES_PACKAGE_FQ_NAME
BUILT_INS_PACKAGE_FQ_NAMES
public static final java.util.Set<FqName> BUILT_INS_PACKAGE_FQ_NAMES
builtInsModule
protected final ModuleDescriptorImpl builtInsModule
FQ_NAMES
public static final KotlinBuiltIns.FqNames FQ_NAMES
KotlinBuiltIns
protected KotlinBuiltIns()
getAdditionalSupertypesProvider
@NotNull
protected AdditionalSupertypes getAdditionalSupertypesProvider()
getBuiltInsModule
@NotNull
public ModuleDescriptorImpl getBuiltInsModule()
getBuiltinsPackageFragments
@NotNull
public java.util.Set<BuiltinsPackageFragment> getBuiltinsPackageFragments()
getBuiltInsPackageFragment
@NotNull
public PackageFragmentDescriptor getBuiltInsPackageFragment()
getCollectionsPackageFragment
@NotNull
public BuiltinsPackageFragment getCollectionsPackageFragment()
getRangesPackageFragment
@NotNull
public BuiltinsPackageFragment getRangesPackageFragment()
getAnnotationPackageFragment
@NotNull
public BuiltinsPackageFragment getAnnotationPackageFragment()
isBuiltInPackageFragment
public boolean isBuiltInPackageFragment(@Nullable
PackageFragmentDescriptor packageFragment)
getBuiltInsPackageScope
@NotNull
public MemberScope getBuiltInsPackageScope()
getAnnotationClassByName
@NotNull
public ClassDescriptor getAnnotationClassByName(@NotNull
Name simpleName)
getBuiltInClassByName
@NotNull
public ClassDescriptor getBuiltInClassByName(@NotNull
Name simpleName)
getBuiltInClassByNameNullable
@Nullable
public ClassDescriptor getBuiltInClassByNameNullable(@NotNull
Name simpleName)
getBuiltInClassByFqNameNullable
@Nullable
public ClassDescriptor getBuiltInClassByFqNameNullable(@NotNull
FqName fqName)
getAny
@NotNull
public ClassDescriptor getAny()
getNothing
@NotNull
public ClassDescriptor getNothing()
getPrimitiveClassDescriptor
@NotNull
public ClassDescriptor getPrimitiveClassDescriptor(@NotNull
PrimitiveType type)
getByte
@NotNull
public ClassDescriptor getByte()
getShort
@NotNull
public ClassDescriptor getShort()
getInt
@NotNull
public ClassDescriptor getInt()
getLong
@NotNull
public ClassDescriptor getLong()
getFloat
@NotNull
public ClassDescriptor getFloat()
getDouble
@NotNull
public ClassDescriptor getDouble()
getChar
@NotNull
public ClassDescriptor getChar()
getBoolean
@NotNull
public ClassDescriptor getBoolean()
getIntegralRanges
@NotNull
public java.util.Set<DeclarationDescriptor> getIntegralRanges()
getArray
@NotNull
public ClassDescriptor getArray()
getPrimitiveArrayClassDescriptor
@NotNull
public ClassDescriptor getPrimitiveArrayClassDescriptor(@NotNull
PrimitiveType type)
getNumber
@NotNull
public ClassDescriptor getNumber()
getUnit
@NotNull
public ClassDescriptor getUnit()
getFunctionName
@NotNull
public static java.lang.String getFunctionName(int parameterCount)
getExtensionFunctionName
@NotNull
public static java.lang.String getExtensionFunctionName(int parameterCount)
getFunction
@NotNull
public ClassDescriptor getFunction(int parameterCount)
getExtensionFunction
@Deprecated
@NotNull
public ClassDescriptor getExtensionFunction(int parameterCount)
- Deprecated. there are no ExtensionFunction classes anymore, use
getFunction(int)
instead
- Returns:
- the descriptor representing the class kotlin.Function{parameterCount + 1}
getThrowable
@NotNull
public ClassDescriptor getThrowable()
getCloneable
@NotNull
public ClassDescriptor getCloneable()
getDeprecatedAnnotation
@NotNull
public ClassDescriptor getDeprecatedAnnotation()
getDeprecationLevelEnum
@NotNull
public ClassDescriptor getDeprecationLevelEnum()
getDeprecationLevelEnumEntry
@Nullable
public ClassDescriptor getDeprecationLevelEnumEntry(@NotNull
java.lang.String level)
getTargetAnnotation
@NotNull
public ClassDescriptor getTargetAnnotation()
getRetentionAnnotation
@NotNull
public ClassDescriptor getRetentionAnnotation()
getRepeatableAnnotation
@NotNull
public ClassDescriptor getRepeatableAnnotation()
getMustBeDocumentedAnnotation
@NotNull
public ClassDescriptor getMustBeDocumentedAnnotation()
getAnnotationTargetEnum
@NotNull
public ClassDescriptor getAnnotationTargetEnum()
getAnnotationTargetEnumEntry
@Nullable
public ClassDescriptor getAnnotationTargetEnumEntry(@NotNull
KotlinTarget target)
getAnnotationRetentionEnum
@NotNull
public ClassDescriptor getAnnotationRetentionEnum()
getAnnotationRetentionEnumEntry
@Nullable
public ClassDescriptor getAnnotationRetentionEnumEntry(@NotNull
KotlinRetention retention)
getString
@NotNull
public ClassDescriptor getString()
getCharSequence
@NotNull
public ClassDescriptor getCharSequence()
getComparable
@NotNull
public ClassDescriptor getComparable()
getEnum
@NotNull
public ClassDescriptor getEnum()
getAnnotation
@NotNull
public ClassDescriptor getAnnotation()
getIterator
@NotNull
public ClassDescriptor getIterator()
getIterable
@NotNull
public ClassDescriptor getIterable()
getMutableIterable
@NotNull
public ClassDescriptor getMutableIterable()
getMutableIterator
@NotNull
public ClassDescriptor getMutableIterator()
getCollection
@NotNull
public ClassDescriptor getCollection()
getMutableCollection
@NotNull
public ClassDescriptor getMutableCollection()
getList
@NotNull
public ClassDescriptor getList()
getMutableList
@NotNull
public ClassDescriptor getMutableList()
getSet
@NotNull
public ClassDescriptor getSet()
getMutableSet
@NotNull
public ClassDescriptor getMutableSet()
getMap
@NotNull
public ClassDescriptor getMap()
getMutableMap
@NotNull
public ClassDescriptor getMutableMap()
getMapEntry
@NotNull
public ClassDescriptor getMapEntry()
getMutableMapEntry
@NotNull
public ClassDescriptor getMutableMapEntry()
getListIterator
@NotNull
public ClassDescriptor getListIterator()
getMutableListIterator
@NotNull
public ClassDescriptor getMutableListIterator()
getNothingType
@NotNull
public KotlinType getNothingType()
getNullableNothingType
@NotNull
public KotlinType getNullableNothingType()
getAnyType
@NotNull
public KotlinType getAnyType()
getNullableAnyType
@NotNull
public KotlinType getNullableAnyType()
getDefaultBound
@NotNull
public KotlinType getDefaultBound()
getPrimitiveKotlinType
@NotNull
public KotlinType getPrimitiveKotlinType(@NotNull
PrimitiveType type)
getByteType
@NotNull
public KotlinType getByteType()
getShortType
@NotNull
public KotlinType getShortType()
getIntType
@NotNull
public KotlinType getIntType()
getLongType
@NotNull
public KotlinType getLongType()
getFloatType
@NotNull
public KotlinType getFloatType()
getDoubleType
@NotNull
public KotlinType getDoubleType()
getCharType
@NotNull
public KotlinType getCharType()
getBooleanType
@NotNull
public KotlinType getBooleanType()
getUnitType
@NotNull
public KotlinType getUnitType()
getStringType
@NotNull
public KotlinType getStringType()
getArrayElementType
@NotNull
public KotlinType getArrayElementType(@NotNull
KotlinType arrayType)
getPrimitiveArrayKotlinType
@NotNull
public KotlinType getPrimitiveArrayKotlinType(@NotNull
PrimitiveType primitiveType)
getPrimitiveArrayKotlinTypeByPrimitiveKotlinType
@Nullable
public KotlinType getPrimitiveArrayKotlinTypeByPrimitiveKotlinType(@NotNull
KotlinType kotlinType)
- Returns:
null
if not primitive
isPrimitiveArray
public static boolean isPrimitiveArray(@NotNull
FqNameUnsafe arrayFqName)
getPrimitiveTypeByFqName
@Nullable
public static PrimitiveType getPrimitiveTypeByFqName(@NotNull
FqNameUnsafe primitiveClassFqName)
getPrimitiveTypeByArrayClassFqName
@Nullable
public static PrimitiveType getPrimitiveTypeByArrayClassFqName(@NotNull
FqNameUnsafe primitiveArrayClassFqName)
getArrayType
@NotNull
public KotlinType getArrayType(@NotNull
Variance projectionType,
@NotNull
KotlinType argument)
getEnumType
@NotNull
public KotlinType getEnumType(@NotNull
KotlinType argument)
getAnnotationType
@NotNull
public KotlinType getAnnotationType()
createExtensionAnnotation
@NotNull
public AnnotationDescriptor createExtensionAnnotation()
getFunctionType
@NotNull
public KotlinType getFunctionType(@NotNull
Annotations annotations,
@Nullable
KotlinType receiverType,
@NotNull
java.util.List<KotlinType> parameterTypes,
@NotNull
KotlinType returnType)
getFunctionTypeArgumentProjections
@NotNull
public static java.util.List<TypeProjection> getFunctionTypeArgumentProjections(@Nullable
KotlinType receiverType,
@NotNull
java.util.List<KotlinType> parameterTypes,
@NotNull
KotlinType returnType)
isArray
public static boolean isArray(@NotNull
KotlinType type)
isArrayOrPrimitiveArray
public static boolean isArrayOrPrimitiveArray(@NotNull
ClassDescriptor descriptor)
isPrimitiveArray
public static boolean isPrimitiveArray(@NotNull
KotlinType type)
isPrimitiveType
public static boolean isPrimitiveType(@NotNull
KotlinType type)
isPrimitiveClass
public static boolean isPrimitiveClass(@NotNull
ClassDescriptor descriptor)
isFunctionOrExtensionFunctionType
public static boolean isFunctionOrExtensionFunctionType(@NotNull
KotlinType type)
isFunctionType
public static boolean isFunctionType(@NotNull
KotlinType type)
isExtensionFunctionType
public static boolean isExtensionFunctionType(@NotNull
KotlinType type)
isExactFunctionOrExtensionFunctionType
public static boolean isExactFunctionOrExtensionFunctionType(@NotNull
KotlinType type)
isExactFunctionType
public static boolean isExactFunctionType(@NotNull
KotlinType type)
isExactExtensionFunctionType
public static boolean isExactExtensionFunctionType(@NotNull
KotlinType type)
isNumberedFunctionClassFqName
public static boolean isNumberedFunctionClassFqName(@NotNull
FqNameUnsafe fqName)
- Returns:
- true if this is an FQ name of a fictitious class representing the function type,
e.g. kotlin.Function1 (but NOT kotlin.reflect.KFunction1)
getReceiverType
@Nullable
public static KotlinType getReceiverType(@NotNull
KotlinType type)
getValueParameters
@NotNull
public static java.util.List<ValueParameterDescriptor> getValueParameters(@NotNull
FunctionDescriptor functionDescriptor,
@NotNull
KotlinType type)
getReturnTypeFromFunctionType
@NotNull
public static KotlinType getReturnTypeFromFunctionType(@NotNull
KotlinType type)
getParameterTypeProjectionsFromFunctionType
@NotNull
public static java.util.List<TypeProjection> getParameterTypeProjectionsFromFunctionType(@NotNull
KotlinType type)
isSpecialClassWithNoSupertypes
public static boolean isSpecialClassWithNoSupertypes(@NotNull
ClassDescriptor descriptor)
isAny
public static boolean isAny(@NotNull
ClassDescriptor descriptor)
isAny
public static boolean isAny(@NotNull
KotlinType type)
isBoolean
public static boolean isBoolean(@NotNull
KotlinType type)
isBooleanOrNullableBoolean
public static boolean isBooleanOrNullableBoolean(@NotNull
KotlinType type)
isBoolean
public static boolean isBoolean(@NotNull
ClassDescriptor classDescriptor)
isChar
public static boolean isChar(@NotNull
KotlinType type)
isInt
public static boolean isInt(@NotNull
KotlinType type)
isByte
public static boolean isByte(@NotNull
KotlinType type)
isLong
public static boolean isLong(@NotNull
KotlinType type)
isShort
public static boolean isShort(@NotNull
KotlinType type)
isFloat
public static boolean isFloat(@NotNull
KotlinType type)
isDouble
public static boolean isDouble(@NotNull
KotlinType type)
isNothing
public static boolean isNothing(@NotNull
KotlinType type)
isNullableNothing
public static boolean isNullableNothing(@NotNull
KotlinType type)
isNothingOrNullableNothing
public static boolean isNothingOrNullableNothing(@NotNull
KotlinType type)
isAnyOrNullableAny
public static boolean isAnyOrNullableAny(@NotNull
KotlinType type)
isNullableAny
public static boolean isNullableAny(@NotNull
KotlinType type)
isDefaultBound
public static boolean isDefaultBound(@NotNull
KotlinType type)
isUnit
public static boolean isUnit(@NotNull
KotlinType type)
isUnitOrNullableUnit
public static boolean isUnitOrNullableUnit(@NotNull
KotlinType type)
isBooleanOrSubtype
public boolean isBooleanOrSubtype(@NotNull
KotlinType type)
isMemberOfAny
public boolean isMemberOfAny(@NotNull
DeclarationDescriptor descriptor)
isString
public static boolean isString(@Nullable
KotlinType type)
isCollectionOrNullableCollection
public static boolean isCollectionOrNullableCollection(@NotNull
KotlinType type)
isListOrNullableList
public static boolean isListOrNullableList(@NotNull
KotlinType type)
isSetOrNullableSet
public static boolean isSetOrNullableSet(@NotNull
KotlinType type)
isIterableOrNullableIterable
public static boolean isIterableOrNullableIterable(@NotNull
KotlinType type)
isKClass
public static boolean isKClass(@NotNull
ClassDescriptor descriptor)
isNonPrimitiveArray
public static boolean isNonPrimitiveArray(@NotNull
ClassDescriptor descriptor)
isCloneable
public static boolean isCloneable(@NotNull
ClassDescriptor descriptor)
isDeprecated
public static boolean isDeprecated(@NotNull
DeclarationDescriptor declarationDescriptor)
isSuppressAnnotation
public static boolean isSuppressAnnotation(@NotNull
AnnotationDescriptor annotationDescriptor)