org.jetbrains.kotlin.js.translate.context
Class Namer

java.lang.Object
  extended by org.jetbrains.kotlin.js.translate.context.Namer

public final class Namer
extends java.lang.Object

Encapsulates different types of constants and naming conventions.


Field Summary
static java.lang.String ANOTHER_THIS_PARAMETER_NAME
           
static java.lang.String CALL_FUNCTION
           
static java.lang.String CALLEE_NAME
           
static java.lang.String CAPTURED_VAR_FIELD
           
static java.lang.String CHAR_RANGE
           
static java.lang.String COMPARE_TO_METHOD_NAME
           
static JsNameRef CREATE_INLINE_FUNCTION
           
static java.lang.String EQUALS_METHOD_NAME
           
static java.lang.String IS_CHAR
           
static java.lang.String IS_NUMBER
           
static JsNameRef KOTLIN_LONG_NAME_REF
           
static java.lang.String KOTLIN_LOWER_NAME
           
static java.lang.String KOTLIN_NAME
           
static JsNameRef KOTLIN_OBJECT_REF
           
static java.lang.String LONG_FROM_INT
           
static java.lang.String LONG_FROM_NUMBER
           
static java.lang.String LONG_NEG_ONE
           
static java.lang.String LONG_ONE
           
static java.lang.String LONG_TO_NUMBER
           
static java.lang.String LONG_ZERO
           
static java.lang.String NUMBER_RANGE
           
static java.lang.String PRIMITIVE_COMPARE_TO
           
static JsExpression UNDEFINED_EXPRESSION
           
 
Method Summary
 JsExpression callableRefForConstructorReference()
           
 JsExpression callableRefForExtensionFunctionReference()
           
 JsExpression callableRefForExtensionPropertyReference()
           
 JsExpression callableRefForLocalExtensionFunctionReference()
           
 JsExpression callableRefForMemberFunctionReference()
           
 JsExpression callableRefForMemberPropertyReference()
           
 JsExpression callableRefForTopLevelPropertyReference()
           
 JsExpression classCreateInvocation(ClassDescriptor descriptor)
           
 JsExpression classCreationMethodReference()
           
static JsInvocation createObjectWithPrototypeFrom(JsNameRef referenceToClass)
           
 JsExpression enumClassCreationMethodReference()
           
 JsExpression getCallGetProperty()
           
 JsExpression getCallSetProperty()
           
static JsNameRef getCapturedVarAccessor(JsExpression ref)
           
static JsExpression getCompanionObjectAccessor(JsExpression referenceToClass)
           
static java.lang.String getDelegateName(java.lang.String propertyName)
           
static JsNameRef getDelegateNameRef(java.lang.String propertyName)
           
static java.lang.String getDelegatePrefix()
           
static JsNameRef getFunctionApplyRef(JsExpression functionExpression)
           
static JsNameRef getFunctionCallRef(JsExpression functionExpression)
           
static java.lang.String getFunctionTag(CallableDescriptor functionDescriptor)
           
static java.lang.String getKotlinBackingFieldName(java.lang.String propertyName)
           
 JsExpression getModuleReference(JsStringLiteral moduleName)
           
static java.lang.String getNameForAccessor(java.lang.String propertyName, boolean isGetter, boolean useNativeAccessor)
           
static java.lang.String getNameForCompanionObjectInitializer()
           
static java.lang.String getPrototypeName()
           
static java.lang.String getReceiverParameterName()
           
static JsNameRef getRefToPrototype(JsExpression classOrTraitExpression)
           
static java.lang.String getRootPackageName()
           
 JsExpression getUndefinedExpression()
           
 JsExpression isInstanceOf(JsExpression type)
           
 JsExpression isInstanceOf(JsExpression instance, JsExpression type)
           
static java.lang.String isInstanceSuggestedName(TypeParameterDescriptor descriptor)
           
 JsExpression isTypeOf(JsExpression type)
           
static boolean isUndefined(JsExpression expr)
           
 JsExpression kotlin(java.lang.String name)
           
 JsNameRef kotlinObject()
           
static Namer newInstance(JsScope rootScope)
           
 JsExpression objectCreationMethodReference()
           
 JsExpression packageDefinitionMethodReference()
           
 JsExpression rootPackageDefinitionMethodReference()
           
static JsNameRef superMethodNameRef(JsName superClassJsName)
           
 JsExpression throwNPEFunctionRef()
           
 JsExpression traitCreationMethodReference()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KOTLIN_NAME

public static final java.lang.String KOTLIN_NAME
See Also:
Constant Field Values

KOTLIN_LOWER_NAME

public static final java.lang.String KOTLIN_LOWER_NAME

KOTLIN_OBJECT_REF

public static final JsNameRef KOTLIN_OBJECT_REF

KOTLIN_LONG_NAME_REF

public static final JsNameRef KOTLIN_LONG_NAME_REF

EQUALS_METHOD_NAME

public static final java.lang.String EQUALS_METHOD_NAME

COMPARE_TO_METHOD_NAME

public static final java.lang.String COMPARE_TO_METHOD_NAME

NUMBER_RANGE

public static final java.lang.String NUMBER_RANGE
See Also:
Constant Field Values

CHAR_RANGE

public static final java.lang.String CHAR_RANGE
See Also:
Constant Field Values

LONG_FROM_NUMBER

public static final java.lang.String LONG_FROM_NUMBER
See Also:
Constant Field Values

LONG_TO_NUMBER

public static final java.lang.String LONG_TO_NUMBER
See Also:
Constant Field Values

LONG_FROM_INT

public static final java.lang.String LONG_FROM_INT
See Also:
Constant Field Values

LONG_ZERO

public static final java.lang.String LONG_ZERO
See Also:
Constant Field Values

LONG_ONE

public static final java.lang.String LONG_ONE
See Also:
Constant Field Values

LONG_NEG_ONE

public static final java.lang.String LONG_NEG_ONE
See Also:
Constant Field Values

PRIMITIVE_COMPARE_TO

public static final java.lang.String PRIMITIVE_COMPARE_TO
See Also:
Constant Field Values

IS_CHAR

public static final java.lang.String IS_CHAR
See Also:
Constant Field Values

IS_NUMBER

public static final java.lang.String IS_NUMBER
See Also:
Constant Field Values

CALLEE_NAME

public static final java.lang.String CALLEE_NAME
See Also:
Constant Field Values

CALL_FUNCTION

public static final java.lang.String CALL_FUNCTION
See Also:
Constant Field Values

ANOTHER_THIS_PARAMETER_NAME

public static final java.lang.String ANOTHER_THIS_PARAMETER_NAME
See Also:
Constant Field Values

CAPTURED_VAR_FIELD

public static final java.lang.String CAPTURED_VAR_FIELD
See Also:
Constant Field Values

CREATE_INLINE_FUNCTION

public static final JsNameRef CREATE_INLINE_FUNCTION

UNDEFINED_EXPRESSION

@NotNull
public static final JsExpression UNDEFINED_EXPRESSION
Method Detail

isUndefined

public static boolean isUndefined(@NotNull
                                  JsExpression expr)

getFunctionTag

@NotNull
public static java.lang.String getFunctionTag(@NotNull
                                                      CallableDescriptor functionDescriptor)

getReceiverParameterName

@NotNull
public static java.lang.String getReceiverParameterName()

getRootPackageName

@NotNull
public static java.lang.String getRootPackageName()

superMethodNameRef

@NotNull
public static JsNameRef superMethodNameRef(@NotNull
                                                   JsName superClassJsName)

getNameForAccessor

@NotNull
public static java.lang.String getNameForAccessor(@NotNull
                                                          java.lang.String propertyName,
                                                          boolean isGetter,
                                                          boolean useNativeAccessor)

getKotlinBackingFieldName

@NotNull
public static java.lang.String getKotlinBackingFieldName(@NotNull
                                                                 java.lang.String propertyName)

getCompanionObjectAccessor

@NotNull
public static JsExpression getCompanionObjectAccessor(@NotNull
                                                              JsExpression referenceToClass)

getNameForCompanionObjectInitializer

@NotNull
public static java.lang.String getNameForCompanionObjectInitializer()

getPrototypeName

@NotNull
public static java.lang.String getPrototypeName()

getRefToPrototype

@NotNull
public static JsNameRef getRefToPrototype(@NotNull
                                                  JsExpression classOrTraitExpression)

getDelegatePrefix

@NotNull
public static java.lang.String getDelegatePrefix()

getDelegateName

@NotNull
public static java.lang.String getDelegateName(@NotNull
                                                       java.lang.String propertyName)

getDelegateNameRef

@NotNull
public static JsNameRef getDelegateNameRef(java.lang.String propertyName)

getFunctionCallRef

@NotNull
public static JsNameRef getFunctionCallRef(@NotNull
                                                   JsExpression functionExpression)

getFunctionApplyRef

@NotNull
public static JsNameRef getFunctionApplyRef(@NotNull
                                                    JsExpression functionExpression)

createObjectWithPrototypeFrom

@NotNull
public static JsInvocation createObjectWithPrototypeFrom(JsNameRef referenceToClass)

getCapturedVarAccessor

@NotNull
public static JsNameRef getCapturedVarAccessor(@NotNull
                                                       JsExpression ref)

isInstanceSuggestedName

@NotNull
public static java.lang.String isInstanceSuggestedName(@NotNull
                                                               TypeParameterDescriptor descriptor)

newInstance

@NotNull
public static Namer newInstance(@NotNull
                                        JsScope rootScope)

classCreationMethodReference

@NotNull
public JsExpression classCreationMethodReference()

enumClassCreationMethodReference

@NotNull
public JsExpression enumClassCreationMethodReference()

traitCreationMethodReference

@NotNull
public JsExpression traitCreationMethodReference()

packageDefinitionMethodReference

@NotNull
public JsExpression packageDefinitionMethodReference()

rootPackageDefinitionMethodReference

@NotNull
public JsExpression rootPackageDefinitionMethodReference()

objectCreationMethodReference

@NotNull
public JsExpression objectCreationMethodReference()

callableRefForMemberFunctionReference

@NotNull
public JsExpression callableRefForMemberFunctionReference()

callableRefForExtensionFunctionReference

@NotNull
public JsExpression callableRefForExtensionFunctionReference()

callableRefForLocalExtensionFunctionReference

@NotNull
public JsExpression callableRefForLocalExtensionFunctionReference()

callableRefForConstructorReference

@NotNull
public JsExpression callableRefForConstructorReference()

callableRefForTopLevelPropertyReference

@NotNull
public JsExpression callableRefForTopLevelPropertyReference()

callableRefForMemberPropertyReference

@NotNull
public JsExpression callableRefForMemberPropertyReference()

callableRefForExtensionPropertyReference

@NotNull
public JsExpression callableRefForExtensionPropertyReference()

throwNPEFunctionRef

@NotNull
public JsExpression throwNPEFunctionRef()

kotlin

@NotNull
public JsExpression kotlin(@NotNull
                                   java.lang.String name)

kotlinObject

@NotNull
public JsNameRef kotlinObject()

isTypeOf

@NotNull
public JsExpression isTypeOf(@NotNull
                                     JsExpression type)

isInstanceOf

@NotNull
public JsExpression isInstanceOf(@NotNull
                                         JsExpression type)

isInstanceOf

@NotNull
public JsExpression isInstanceOf(@NotNull
                                         JsExpression instance,
                                         @NotNull
                                         JsExpression type)

classCreateInvocation

@NotNull
public JsExpression classCreateInvocation(@NotNull
                                                  ClassDescriptor descriptor)

getUndefinedExpression

@NotNull
public JsExpression getUndefinedExpression()

getCallGetProperty

@NotNull
public JsExpression getCallGetProperty()

getCallSetProperty

@NotNull
public JsExpression getCallSetProperty()

getModuleReference

@NotNull
public JsExpression getModuleReference(@NotNull
                                               JsStringLiteral moduleName)