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, JetOperationExpression expression)
           
static ClassDescriptor getClassDescriptor(BindingContext context, JetClassOrObject declaration)
           
static ClassDescriptor getClassDescriptorForTypeReference(BindingContext context, JetTypeReference typeReference)
           
static java.lang.Object getCompileTimeValue(BindingContext context, JetExpression expression)
           
static java.lang.Object getCompileTimeValue(BindingContext context, JetExpression expression, CompileTimeConstant<?> constant)
           
static ConstructorDescriptor getConstructor(BindingContext bindingContext, JetClassOrObject declaration)
           
static JetExpression getDefaultArgument(ValueParameterDescriptor parameterDescriptor)
           
static DeclarationDescriptor getDescriptorForElement(BindingContext context, com.intellij.psi.PsiElement element)
           
static DeclarationDescriptor getDescriptorForReferenceExpression(BindingContext context, JetReferenceExpression reference)
           
static FunctionDescriptor getFunctionDescriptor(BindingContext context, JetDeclarationWithBody declaration)
           
static ResolvedCall<FunctionDescriptor> getHasNextCallable(BindingContext context, JetExpression rangeExpression)
           
static ResolvedCall<FunctionDescriptor> getIteratorFunction(BindingContext context, JetExpression rangeExpression)
           
static ResolvedCall<FunctionDescriptor> getNextFunction(BindingContext context, JetExpression rangeExpression)
           
static SimpleFunctionDescriptor getNullableDescriptorForFunction(BindingContext bindingContext, JetNamedFunction function)
           
static DeclarationDescriptor getNullableDescriptorForReferenceExpression(BindingContext context, JetReferenceExpression reference)
           
static PropertyDescriptor getPropertyDescriptor(BindingContext context, JetProperty declaration)
           
static PropertyDescriptor getPropertyDescriptorForConstructorParameter(BindingContext context, JetParameter parameter)
           
static ResolvedCall<FunctionDescriptor> getResolvedCallForArrayAccess(BindingContext context, JetArrayAccessExpression arrayAccessExpression, boolean isGet)
           
static JetType getTypeByReference(BindingContext context, JetTypeReference typeReference)
           
static JetType getTypeForExpression(BindingContext context, JetExpression expression)
           
static boolean hasAncestorClass(BindingContext context, JetClassOrObject classDeclaration)
           
static boolean isVariableReassignment(BindingContext context, JetExpression 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
                                                         JetClassOrObject declaration)

getFunctionDescriptor

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

getPropertyDescriptor

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

hasAncestorClass

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

getTypeByReference

@NotNull
public static JetType getTypeByReference(@NotNull
                                                 BindingContext context,
                                                 @NotNull
                                                 JetTypeReference typeReference)

getClassDescriptorForTypeReference

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

getPropertyDescriptorForConstructorParameter

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

getDescriptorForReferenceExpression

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

getNullableDescriptorForReferenceExpression

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

isVariableReassignment

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

getCallableDescriptorForOperationExpression

@Nullable
public static CallableDescriptor getCallableDescriptorForOperationExpression(@NotNull
                                                                                      BindingContext context,
                                                                                      @NotNull
                                                                                      JetOperationExpression 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
                                                            JetExpression expression)

getCompileTimeValue

@Nullable
public static java.lang.Object getCompileTimeValue(@NotNull
                                                            BindingContext context,
                                                            @NotNull
                                                            JetExpression expression,
                                                            @NotNull
                                                            CompileTimeConstant<?> constant)

getDefaultArgument

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

getIteratorFunction

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

getNextFunction

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

getHasNextCallable

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

getTypeForExpression

@NotNull
public static JetType getTypeForExpression(@NotNull
                                                   BindingContext context,
                                                   @NotNull
                                                   JetExpression expression)

getResolvedCallForArrayAccess

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

getConstructor

public static ConstructorDescriptor getConstructor(@NotNull
                                                   BindingContext bindingContext,
                                                   @NotNull
                                                   JetClassOrObject declaration)

getNullableDescriptorForFunction

@Nullable
public static SimpleFunctionDescriptor getNullableDescriptorForFunction(@NotNull
                                                                                 BindingContext bindingContext,
                                                                                 @NotNull
                                                                                 JetNamedFunction function)