org.jetbrains.kotlin.js.translate.utils
Class BindingUtils

java.lang.Object
  extended by org.jetbrains.kotlin.js.translate.utils.BindingUtils

public final class BindingUtils
extends java.lang.Object

This class contains some code related to BindingContext use. Intention is not to pollute other classes. Every call to BindingContext.get() is supposed to be wrapped by this utility class.


Method Summary
static CallableDescriptor getCallableDescriptorForOperationExpression(BindingContext context, KtOperationExpression expression)
           
static ClassDescriptor getClassDescriptor(BindingContext context, KtClassOrObject declaration)
           
static ClassDescriptor getClassDescriptorForTypeReference(BindingContext context, KtTypeReference typeReference)
           
static java.lang.Object getCompileTimeValue(BindingContext context, KtExpression expression)
           
static java.lang.Object getCompileTimeValue(BindingContext context, KtExpression expression,  constant)
           
static KtExpression getDefaultArgument(ValueParameterDescriptor parameterDescriptor)
           
static DeclarationDescriptor getDescriptorForElement(BindingContext context, com.intellij.psi.PsiElement element)
           
static DeclarationDescriptor getDescriptorForReferenceExpression(BindingContext context, KtReferenceExpression reference)
           
static FunctionDescriptor getFunctionDescriptor(BindingContext context, KtDeclarationWithBody declaration)
           
static ResolvedCall<FunctionDescriptor> getHasNextCallable(BindingContext context, KtExpression rangeExpression)
           
static ResolvedCall<FunctionDescriptor> getIteratorFunction(BindingContext context, KtExpression rangeExpression)
           
static ResolvedCall<FunctionDescriptor> getNextFunction(BindingContext context, KtExpression rangeExpression)
           
static DeclarationDescriptor getNullableDescriptorForReferenceExpression(BindingContext context, KtReferenceExpression reference)
           
static PropertyDescriptor getPropertyDescriptor(BindingContext context, KtProperty declaration)
           
static PropertyDescriptor getPropertyDescriptorForConstructorParameter(BindingContext context, KtParameter parameter)
           
static ResolvedCall<FunctionDescriptor> getResolvedCallForArrayAccess(BindingContext context, KtArrayAccessExpression arrayAccessExpression, boolean isGet)
           
static KotlinType getTypeByReference(BindingContext context, KtTypeReference typeReference)
           
static KotlinType getTypeForExpression(BindingContext context, KtExpression expression)
           
static boolean hasAncestorClass(BindingContext context, KtClassOrObject classDeclaration)
           
static boolean isVariableReassignment(BindingContext context, KtExpression expression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClassDescriptor

@NotNull
public static ClassDescriptor getClassDescriptor(@NotNull
                                                         BindingContext context,
                                                         @NotNull
                                                         KtClassOrObject declaration)

getFunctionDescriptor

@NotNull
public static FunctionDescriptor getFunctionDescriptor(@NotNull
                                                               BindingContext context,
                                                               @NotNull
                                                               KtDeclarationWithBody declaration)

getPropertyDescriptor

@NotNull
public static PropertyDescriptor getPropertyDescriptor(@NotNull
                                                               BindingContext context,
                                                               @NotNull
                                                               KtProperty declaration)

hasAncestorClass

public static boolean hasAncestorClass(@NotNull
                                       BindingContext context,
                                       @NotNull
                                       KtClassOrObject classDeclaration)

getTypeByReference

@NotNull
public static KotlinType getTypeByReference(@NotNull
                                                    BindingContext context,
                                                    @NotNull
                                                    KtTypeReference typeReference)

getClassDescriptorForTypeReference

@NotNull
public static ClassDescriptor getClassDescriptorForTypeReference(@NotNull
                                                                         BindingContext context,
                                                                         @NotNull
                                                                         KtTypeReference typeReference)

getPropertyDescriptorForConstructorParameter

@Nullable
public static PropertyDescriptor getPropertyDescriptorForConstructorParameter(@NotNull
                                                                                       BindingContext context,
                                                                                       @NotNull
                                                                                       KtParameter parameter)

getDescriptorForReferenceExpression

@Nullable
public static DeclarationDescriptor getDescriptorForReferenceExpression(@NotNull
                                                                                 BindingContext context,
                                                                                 @NotNull
                                                                                 KtReferenceExpression reference)

getNullableDescriptorForReferenceExpression

@Nullable
public static DeclarationDescriptor getNullableDescriptorForReferenceExpression(@NotNull
                                                                                         BindingContext context,
                                                                                         @NotNull
                                                                                         KtReferenceExpression reference)

isVariableReassignment

public static boolean isVariableReassignment(@NotNull
                                             BindingContext context,
                                             @NotNull
                                             KtExpression expression)

getCallableDescriptorForOperationExpression

@Nullable
public static CallableDescriptor getCallableDescriptorForOperationExpression(@NotNull
                                                                                      BindingContext context,
                                                                                      @NotNull
                                                                                      KtOperationExpression expression)

getDescriptorForElement

@NotNull
public static DeclarationDescriptor getDescriptorForElement(@NotNull
                                                                    BindingContext context,
                                                                    @NotNull
                                                                    com.intellij.psi.PsiElement element)

getCompileTimeValue

@Nullable
public static java.lang.Object getCompileTimeValue(@NotNull
                                                            BindingContext context,
                                                            @NotNull
                                                            KtExpression expression)

getCompileTimeValue

@Nullable
public static java.lang.Object getCompileTimeValue(@NotNull
                                                            BindingContext context,
                                                            @NotNull
                                                            KtExpression expression,
                                                            @NotNull
                                                             constant)

getDefaultArgument

@NotNull
public static KtExpression getDefaultArgument(@NotNull
                                                      ValueParameterDescriptor parameterDescriptor)

getIteratorFunction

@NotNull
public static ResolvedCall<FunctionDescriptor> getIteratorFunction(@NotNull
                                                                           BindingContext context,
                                                                           @NotNull
                                                                           KtExpression rangeExpression)

getNextFunction

@NotNull
public static ResolvedCall<FunctionDescriptor> getNextFunction(@NotNull
                                                                       BindingContext context,
                                                                       @NotNull
                                                                       KtExpression rangeExpression)

getHasNextCallable

@NotNull
public static ResolvedCall<FunctionDescriptor> getHasNextCallable(@NotNull
                                                                          BindingContext context,
                                                                          @NotNull
                                                                          KtExpression rangeExpression)

getTypeForExpression

@NotNull
public static KotlinType getTypeForExpression(@NotNull
                                                      BindingContext context,
                                                      @NotNull
                                                      KtExpression expression)

getResolvedCallForArrayAccess

@NotNull
public static ResolvedCall<FunctionDescriptor> getResolvedCallForArrayAccess(@NotNull
                                                                                     BindingContext context,
                                                                                     @NotNull
                                                                                     KtArrayAccessExpression arrayAccessExpression,
                                                                                     boolean isGet)