org.jetbrains.kotlin.builtins
Class KotlinBuiltIns

java.lang.Object
  extended by org.jetbrains.kotlin.builtins.KotlinBuiltIns

public class KotlinBuiltIns
extends java.lang.Object


Nested Class Summary
static class KotlinBuiltIns.FqNames
           
 
Field Summary
static FqName ANNOTATION_PACKAGE_FQ_NAME
           
static FqName BUILT_INS_PACKAGE_FQ_NAME
           
static java.util.Set<FqName> BUILT_INS_PACKAGE_FQ_NAMES
           
static Name BUILT_INS_PACKAGE_NAME
           
static KotlinBuiltIns.FqNames FQ_NAMES
           
 
Method Summary
 AnnotationDescriptor createExtensionAnnotation()
           
 ClassDescriptor getAnnotation()
           
 ClassDescriptor getAnnotationAnnotation()
           
 ClassDescriptor getAnnotationClassByName(Name simpleName)
           
 JetScope getAnnotationPackageScope()
           
 ClassDescriptor getAnnotationRetentionEnum()
           
 ClassDescriptor getAnnotationRetentionEnumEntry(KotlinRetention retention)
           
 ClassDescriptor getAnnotationTargetEnum()
           
 ClassDescriptor getAnnotationTargetEnumEntry(KotlinTarget target)
           
 JetType getAnnotationType()
           
 ClassDescriptor getAny()
           
 JetType getAnyType()
           
 ClassDescriptor getArray()
           
 JetType getArrayElementType(JetType arrayType)
           
 JetType getArrayType(Variance projectionType, JetType argument)
           
 ClassDescriptor getBoolean()
           
 JetType getBooleanType()
           
 ClassDescriptor getBuiltInClassByName(Name simpleName)
           
 ClassDescriptor getBuiltInClassByNameNullable(Name simpleName)
           
 ModuleDescriptorImpl getBuiltInsModule()
           
 PackageFragmentDescriptor getBuiltInsPackageFragment()
           
 JetScope getBuiltInsPackageScope()
           
 ClassDescriptor getByte()
           
 JetType getByteType()
           
 ClassDescriptor getChar()
           
 ClassDescriptor getCharSequence()
           
 JetType getCharType()
           
 ClassDescriptor getCloneable()
           
 ClassDescriptor getCollection()
           
 ClassDescriptor getComparable()
           
 JetType getDefaultBound()
           
 ClassDescriptor getDeprecatedAnnotation()
           
 ClassDescriptor getDouble()
           
 JetType getDoubleType()
           
 ClassDescriptor getEnum()
           
 JetType getEnumType(JetType argument)
           
 ClassDescriptor getExtensionFunction(int parameterCount)
          Deprecated. there are no ExtensionFunction classes anymore, use getFunction(int) instead
 ClassDescriptor getFloat()
           
 JetType getFloatType()
           
 ClassDescriptor getFunction(int parameterCount)
           
 JetType getFunctionType(Annotations annotations, JetType receiverType, java.util.List<JetType> parameterTypes, JetType returnType)
           
static java.util.List<TypeProjection> getFunctionTypeArgumentProjections(JetType receiverType, java.util.List<JetType> parameterTypes, JetType returnType)
           
 FunctionDescriptor getIdentityEquals()
           
static KotlinBuiltIns getInstance()
           
 ClassDescriptor getInt()
           
 java.util.Set<DeclarationDescriptor> getIntegralRanges()
           
 JetType getIntType()
           
 ClassDescriptor getIterable()
           
 ClassDescriptor getIterator()
           
 ClassDescriptor getList()
           
 ClassDescriptor getListIterator()
           
 ClassDescriptor getLong()
           
 JetType getLongType()
           
 ClassDescriptor getMap()
           
 ClassDescriptor getMapEntry()
           
 ClassDescriptor getMustBeDocumentedAnnotation()
           
 ClassDescriptor getMutableCollection()
           
 ClassDescriptor getMutableIterable()
           
 ClassDescriptor getMutableIterator()
           
 ClassDescriptor getMutableList()
           
 ClassDescriptor getMutableListIterator()
           
 ClassDescriptor getMutableMap()
           
 ClassDescriptor getMutableMapEntry()
           
 ClassDescriptor getMutableSet()
           
 ClassDescriptor getNothing()
           
 JetType getNothingType()
           
 JetType getNullableAnyType()
           
 JetType getNullableNothingType()
           
 ClassDescriptor getNumber()
           
static java.util.List<TypeProjection> getParameterTypeProjectionsFromFunctionType(JetType type)
           
 ClassDescriptor getPrimitiveArrayClassDescriptor(PrimitiveType type)
           
 JetType getPrimitiveArrayJetType(PrimitiveType primitiveType)
           
 JetType getPrimitiveArrayJetTypeByPrimitiveJetType(JetType jetType)
           
 ClassDescriptor getPrimitiveClassDescriptor(PrimitiveType type)
           
 JetType getPrimitiveJetType(PrimitiveType type)
           
static PrimitiveType getPrimitiveTypeByArrayClassFqName(FqNameUnsafe primitiveArrayClassFqName)
           
static PrimitiveType getPrimitiveTypeByFqName(FqNameUnsafe primitiveClassFqName)
           
 ClassDescriptor getPropertyMetadata()
           
 ClassDescriptor getPropertyMetadataImpl()
           
static JetType getReceiverType(JetType type)
           
 ClassDescriptor getRepeatableAnnotation()
           
 ClassDescriptor getRetentionAnnotation()
           
static JetType getReturnTypeFromFunctionType(JetType type)
           
 ClassDescriptor getSet()
           
 ClassDescriptor getShort()
           
 JetType getShortType()
           
 ClassDescriptor getString()
           
 JetType getStringType()
           
 ClassDescriptor getTargetAnnotation()
           
 ClassDescriptor getThrowable()
           
 ClassDescriptor getUnit()
           
 JetType getUnitType()
           
static java.util.List<ValueParameterDescriptor> getValueParameters(FunctionDescriptor functionDescriptor, JetType type)
           
static boolean isAnnotation(ClassDescriptor descriptor)
           
static boolean isAny(ClassDescriptor descriptor)
           
static boolean isAny(FqNameUnsafe fqName)
           
static boolean isAnyOrNullableAny(JetType type)
           
static boolean isArray(JetType type)
           
static boolean isBoolean(ClassDescriptor classDescriptor)
           
static boolean isBoolean(JetType type)
           
static boolean isBooleanOrNullableBoolean(JetType type)
           
 boolean isBooleanOrSubtype(JetType type)
           
static boolean isByte(JetType type)
           
static boolean isChar(JetType type)
           
static boolean isCloneable(ClassDescriptor descriptor)
           
static boolean isCollectionOrNullableCollection(JetType type)
           
static boolean isData(ClassDescriptor classDescriptor)
           
static boolean isDefaultBound(JetType type)
           
static boolean isDeprecated(DeclarationDescriptor declarationDescriptor)
           
static boolean isDouble(JetType type)
           
static boolean isExactExtensionFunctionType(JetType type)
           
static boolean isExactFunctionOrExtensionFunctionType(JetType type)
           
static boolean isExactFunctionType(JetType type)
           
static boolean isExtensionFunctionType(JetType type)
           
static boolean isFloat(JetType type)
           
static boolean isFunctionOrExtensionFunctionType(JetType type)
           
static boolean isFunctionType(JetType type)
           
static boolean isInt(JetType type)
           
static boolean isIterableOrNullableIterable(JetType type)
           
static boolean isKClass(ClassDescriptor descriptor)
           
static boolean isListOrNullableList(JetType type)
           
static boolean isLong(JetType type)
           
static boolean isNoinline(DeclarationDescriptor descriptor)
          Checks that the symbol represented by the descriptor is annotated with the kotlin.noinline annotation
static boolean isNonPrimitiveArray(ClassDescriptor descriptor)
           
static boolean isNothing(JetType type)
           
static boolean isNothingOrNullableNothing(JetType type)
           
static boolean isNullableAny(JetType type)
           
static boolean isNullableNothing(JetType type)
           
static boolean isNumberedFunctionClassFqName(FqNameUnsafe fqName)
           
static boolean isPrimitiveArray(JetType type)
           
static boolean isPrimitiveClass(ClassDescriptor descriptor)
           
static boolean isPrimitiveType(JetType type)
           
static boolean isSetOrNullableSet(JetType type)
           
static boolean isShort(JetType type)
           
static boolean isSpecialClassWithNoSupertypes(ClassDescriptor descriptor)
           
static boolean isString(JetType type)
           
static boolean isSuppressAnnotation(AnnotationDescriptor annotationDescriptor)
           
static boolean isTailRecursive(DeclarationDescriptor declarationDescriptor)
           
static boolean isUnit(JetType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

BUILT_INS_PACKAGE_FQ_NAMES

public static final java.util.Set<FqName> BUILT_INS_PACKAGE_FQ_NAMES

FQ_NAMES

public static final KotlinBuiltIns.FqNames FQ_NAMES
Method Detail

getInstance

@NotNull
public static KotlinBuiltIns getInstance()

getBuiltInsModule

@NotNull
public ModuleDescriptorImpl getBuiltInsModule()

getBuiltInsPackageFragment

@NotNull
public PackageFragmentDescriptor getBuiltInsPackageFragment()

getBuiltInsPackageScope

@NotNull
public JetScope getBuiltInsPackageScope()

getAnnotationPackageScope

@NotNull
public JetScope getAnnotationPackageScope()

getAnnotationClassByName

@NotNull
public ClassDescriptor getAnnotationClassByName(@NotNull
                                                        Name simpleName)

getBuiltInClassByName

@NotNull
public ClassDescriptor getBuiltInClassByName(@NotNull
                                                     Name simpleName)

getBuiltInClassByNameNullable

@Nullable
public ClassDescriptor getBuiltInClassByNameNullable(@NotNull
                                                              Name simpleName)

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()

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()

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)

getAnnotationAnnotation

@NotNull
public ClassDescriptor getAnnotationAnnotation()

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 JetType getNothingType()

getNullableNothingType

@NotNull
public JetType getNullableNothingType()

getAnyType

@NotNull
public JetType getAnyType()

getNullableAnyType

@NotNull
public JetType getNullableAnyType()

getPrimitiveJetType

@NotNull
public JetType getPrimitiveJetType(@NotNull
                                           PrimitiveType type)

getByteType

@NotNull
public JetType getByteType()

getShortType

@NotNull
public JetType getShortType()

getIntType

@NotNull
public JetType getIntType()

getLongType

@NotNull
public JetType getLongType()

getFloatType

@NotNull
public JetType getFloatType()

getDoubleType

@NotNull
public JetType getDoubleType()

getCharType

@NotNull
public JetType getCharType()

getBooleanType

@NotNull
public JetType getBooleanType()

getUnitType

@NotNull
public JetType getUnitType()

getStringType

@NotNull
public JetType getStringType()

getArrayElementType

@NotNull
public JetType getArrayElementType(@NotNull
                                           JetType arrayType)

getPrimitiveArrayJetType

@NotNull
public JetType getPrimitiveArrayJetType(@NotNull
                                                PrimitiveType primitiveType)

getPrimitiveArrayJetTypeByPrimitiveJetType

@Nullable
public JetType getPrimitiveArrayJetTypeByPrimitiveJetType(@NotNull
                                                                   JetType jetType)
Returns:
null if not primitive

getPrimitiveTypeByFqName

@Nullable
public static PrimitiveType getPrimitiveTypeByFqName(@NotNull
                                                              FqNameUnsafe primitiveClassFqName)

getPrimitiveTypeByArrayClassFqName

@Nullable
public static PrimitiveType getPrimitiveTypeByArrayClassFqName(@NotNull
                                                                        FqNameUnsafe primitiveArrayClassFqName)

getArrayType

@NotNull
public JetType getArrayType(@NotNull
                                    Variance projectionType,
                                    @NotNull
                                    JetType argument)

getEnumType

@NotNull
public JetType getEnumType(@NotNull
                                   JetType argument)

getAnnotationType

@NotNull
public JetType getAnnotationType()

getPropertyMetadata

@NotNull
public ClassDescriptor getPropertyMetadata()

getPropertyMetadataImpl

@NotNull
public ClassDescriptor getPropertyMetadataImpl()

createExtensionAnnotation

@NotNull
public AnnotationDescriptor createExtensionAnnotation()

getFunctionType

@NotNull
public JetType getFunctionType(@NotNull
                                       Annotations annotations,
                                       @Nullable
                                       JetType receiverType,
                                       @NotNull
                                       java.util.List<JetType> parameterTypes,
                                       @NotNull
                                       JetType returnType)

getFunctionTypeArgumentProjections

@NotNull
public static java.util.List<TypeProjection> getFunctionTypeArgumentProjections(@Nullable
                                                                                        JetType receiverType,
                                                                                        @NotNull
                                                                                        java.util.List<JetType> parameterTypes,
                                                                                        @NotNull
                                                                                        JetType returnType)

isArray

public static boolean isArray(@NotNull
                              JetType type)

isPrimitiveArray

public static boolean isPrimitiveArray(@NotNull
                                       JetType type)

isPrimitiveType

public static boolean isPrimitiveType(@NotNull
                                      JetType type)

isPrimitiveClass

public static boolean isPrimitiveClass(@NotNull
                                       ClassDescriptor descriptor)

isFunctionOrExtensionFunctionType

public static boolean isFunctionOrExtensionFunctionType(@NotNull
                                                        JetType type)

isFunctionType

public static boolean isFunctionType(@NotNull
                                     JetType type)

isExtensionFunctionType

public static boolean isExtensionFunctionType(@NotNull
                                              JetType type)

isExactFunctionOrExtensionFunctionType

public static boolean isExactFunctionOrExtensionFunctionType(@NotNull
                                                             JetType type)

isExactFunctionType

public static boolean isExactFunctionType(@NotNull
                                          JetType type)

isExactExtensionFunctionType

public static boolean isExactExtensionFunctionType(@NotNull
                                                   JetType 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 JetType getReceiverType(@NotNull
                                               JetType type)

getValueParameters

@NotNull
public static java.util.List<ValueParameterDescriptor> getValueParameters(@NotNull
                                                                                  FunctionDescriptor functionDescriptor,
                                                                                  @NotNull
                                                                                  JetType type)

getReturnTypeFromFunctionType

@NotNull
public static JetType getReturnTypeFromFunctionType(@NotNull
                                                            JetType type)

getParameterTypeProjectionsFromFunctionType

@NotNull
public static java.util.List<TypeProjection> getParameterTypeProjectionsFromFunctionType(@NotNull
                                                                                                 JetType type)

isSpecialClassWithNoSupertypes

public static boolean isSpecialClassWithNoSupertypes(@NotNull
                                                     ClassDescriptor descriptor)

isAny

public static boolean isAny(@NotNull
                            ClassDescriptor descriptor)

isBoolean

public static boolean isBoolean(@NotNull
                                JetType type)

isBooleanOrNullableBoolean

public static boolean isBooleanOrNullableBoolean(@NotNull
                                                 JetType type)

isBoolean

public static boolean isBoolean(@NotNull
                                ClassDescriptor classDescriptor)

isChar

public static boolean isChar(@NotNull
                             JetType type)

isInt

public static boolean isInt(@NotNull
                            JetType type)

isByte

public static boolean isByte(@NotNull
                             JetType type)

isLong

public static boolean isLong(@NotNull
                             JetType type)

isShort

public static boolean isShort(@NotNull
                              JetType type)

isFloat

public static boolean isFloat(@NotNull
                              JetType type)

isDouble

public static boolean isDouble(@NotNull
                               JetType type)

isAny

public static boolean isAny(@NotNull
                            FqNameUnsafe fqName)

isNothing

public static boolean isNothing(@NotNull
                                JetType type)

isNullableNothing

public static boolean isNullableNothing(@NotNull
                                        JetType type)

isNothingOrNullableNothing

public static boolean isNothingOrNullableNothing(@NotNull
                                                 JetType type)

isAnyOrNullableAny

public static boolean isAnyOrNullableAny(@NotNull
                                         JetType type)

isNullableAny

public static boolean isNullableAny(@NotNull
                                    JetType type)

isDefaultBound

public static boolean isDefaultBound(@NotNull
                                     JetType type)

isUnit

public static boolean isUnit(@NotNull
                             JetType type)

isBooleanOrSubtype

public boolean isBooleanOrSubtype(@NotNull
                                  JetType type)

isString

public static boolean isString(@Nullable
                               JetType type)

isCollectionOrNullableCollection

public static boolean isCollectionOrNullableCollection(@NotNull
                                                       JetType type)

isListOrNullableList

public static boolean isListOrNullableList(@NotNull
                                           JetType type)

isSetOrNullableSet

public static boolean isSetOrNullableSet(@NotNull
                                         JetType type)

isIterableOrNullableIterable

public static boolean isIterableOrNullableIterable(@NotNull
                                                   JetType type)

isKClass

public static boolean isKClass(@NotNull
                               ClassDescriptor descriptor)

isNonPrimitiveArray

public static boolean isNonPrimitiveArray(@NotNull
                                          ClassDescriptor descriptor)

isAnnotation

public static boolean isAnnotation(@NotNull
                                   ClassDescriptor descriptor)

isCloneable

public static boolean isCloneable(@NotNull
                                  ClassDescriptor descriptor)

isData

public static boolean isData(@NotNull
                             ClassDescriptor classDescriptor)

isDeprecated

public static boolean isDeprecated(@NotNull
                                   DeclarationDescriptor declarationDescriptor)

isTailRecursive

public static boolean isTailRecursive(@NotNull
                                      DeclarationDescriptor declarationDescriptor)

isNoinline

public static boolean isNoinline(@NotNull
                                 DeclarationDescriptor descriptor)
Checks that the symbol represented by the descriptor is annotated with the kotlin.noinline annotation


isSuppressAnnotation

public static boolean isSuppressAnnotation(@NotNull
                                           AnnotationDescriptor annotationDescriptor)

getDefaultBound

@NotNull
public JetType getDefaultBound()

getIdentityEquals

@NotNull
public FunctionDescriptor getIdentityEquals()