org.jetbrains.k2js.translate.utils
Class BindingUtils
java.lang.Object
org.jetbrains.k2js.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 ClassDescriptor |
getClassDescriptor(BindingContext context,
JetClassOrObject declaration)
|
static ClassDescriptor |
getClassDescriptorForTypeReference(BindingContext context,
JetTypeReference typeReference)
|
static java.lang.Object |
getCompileTimeValue(BindingContext context,
JetExpression expression)
|
static ConstructorDescriptor |
getConstructor(BindingContext bindingContext,
JetClassOrObject declaration)
|
static JetExpression |
getDefaultArgument(BindingContext context,
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 FunctionDescriptor |
getFunctionDescriptorForOperationExpression(BindingContext context,
JetOperationExpression expression)
|
static JetFunction |
getFunctionForDescriptor(BindingContext context,
SimpleFunctionDescriptor descriptor)
|
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 PropertyDescriptor |
getPropertyDescriptorForObjectDeclaration(BindingContext context,
JetObjectDeclarationName name)
|
static ResolvedCall<?> |
getResolvedCall(BindingContext context,
JetExpression expression)
|
static ResolvedCall<FunctionDescriptor> |
getResolvedCallForArrayAccess(BindingContext context,
JetArrayAccessExpression arrayAccessExpression,
boolean isGet)
|
static ResolvedCall<?> |
getResolvedCallForCallExpression(BindingContext context,
JetCallExpression expression)
|
static ResolvedCall<?> |
getResolvedCallForProperty(BindingContext context,
JetExpression expression)
|
static JetType |
getTypeByReference(BindingContext context,
JetTypeReference typeReference)
|
static JetType |
getTypeForExpression(BindingContext context,
JetExpression expression)
|
static boolean |
hasAncestorClass(BindingContext context,
JetClassOrObject classDeclaration)
|
static boolean |
isObjectDeclaration(BindingContext bindingContext,
PropertyDescriptor propertyDescriptor)
|
static boolean |
isStatement(BindingContext context,
JetExpression expression)
|
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 |
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)
getFunctionForDescriptor
@NotNull
public static JetFunction getFunctionForDescriptor(@NotNull
BindingContext context,
@NotNull
SimpleFunctionDescriptor descriptor)
hasAncestorClass
public static boolean hasAncestorClass(@NotNull
BindingContext context,
@NotNull
JetClassOrObject classDeclaration)
isStatement
public static boolean isStatement(@NotNull
BindingContext context,
@NotNull
JetExpression expression)
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)
getResolvedCall
@NotNull
public static ResolvedCall<?> getResolvedCall(@NotNull
BindingContext context,
@NotNull
JetExpression expression)
getResolvedCallForProperty
@NotNull
public static ResolvedCall<?> getResolvedCallForProperty(@NotNull
BindingContext context,
@NotNull
JetExpression expression)
getResolvedCallForCallExpression
@NotNull
public static ResolvedCall<?> getResolvedCallForCallExpression(@NotNull
BindingContext context,
@NotNull
JetCallExpression expression)
isVariableReassignment
public static boolean isVariableReassignment(@NotNull
BindingContext context,
@NotNull
JetExpression expression)
getFunctionDescriptorForOperationExpression
@Nullable
public static FunctionDescriptor getFunctionDescriptorForOperationExpression(@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)
getDefaultArgument
@NotNull
public static JetExpression getDefaultArgument(@NotNull
BindingContext context,
@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)
getPropertyDescriptorForObjectDeclaration
@NotNull
public static PropertyDescriptor getPropertyDescriptorForObjectDeclaration(@NotNull
BindingContext context,
@NotNull
JetObjectDeclarationName name)
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)
isObjectDeclaration
public static boolean isObjectDeclaration(@NotNull
BindingContext bindingContext,
@NotNull
PropertyDescriptor propertyDescriptor)