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 CHAR_RANGE
           
static java.lang.String COMPARE_TO_METHOD_NAME
           
static java.lang.String DEFINE_INLINE_FUNCTION
           
static java.lang.String EQUALS_METHOD_NAME
           
static JsNameRef IS_ARRAY_FUN_REF
           
static java.lang.String IS_CHAR
           
static java.lang.String IS_CHAR_SEQUENCE
           
static java.lang.String IS_NUMBER
           
static java.lang.String KOTLIN_LOWER_NAME
           
static java.lang.String KOTLIN_NAME
           
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 OUTER_FIELD_NAME
           
static java.lang.String PRIMITIVE_COMPARE_TO
           
 
Method Summary
 JsExpression andPredicate(JsExpression a, JsExpression b)
           
 JsExpression callableRefForConstructorReference()
           
 JsExpression callableRefForExtensionFunctionReference()
           
 JsExpression callableRefForExtensionPropertyReference()
           
 JsExpression callableRefForLocalExtensionFunctionReference()
           
 JsExpression callableRefForMemberFunctionReference()
           
 JsExpression callableRefForMemberPropertyReference()
           
 JsExpression callableRefForTopLevelPropertyReference()
           
 JsExpression classCreateInvocation(ClassDescriptor descriptor)
           
 JsExpression classCreationMethodReference()
           
static JsNameRef createInlineFunction()
           
static JsInvocation createObjectWithPrototypeFrom(JsNameRef referenceToClass)
           
 JsExpression enumClassCreationMethodReference()
           
 JsExpression getCallGetProperty()
           
 JsExpression getCallSetProperty()
           
static JsNameRef getCapturedVarAccessor(JsExpression ref)
           
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 getPrototypeName()
           
static java.lang.String getReceiverParameterName()
           
static JsNameRef getRefToPrototype(JsExpression classOrTraitExpression)
           
static java.lang.String getRootPackageName()
           
static JsExpression getUndefinedExpression()
           
 JsExpression isAny()
           
 JsExpression isCharSequence()
           
 JsExpression isComparable()
           
 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)
           
static JsNameRef kotlin(JsName name)
           
 JsNameRef kotlin(java.lang.String name)
           
static JsNameRef kotlinLong()
           
static JsNameRef kotlinObject()
           
static Namer newInstance(JsScope rootScope)
           
 JsExpression objectCreationMethodReference()
           
 JsExpression orNull(JsExpression callable)
           
 JsExpression packageDefinitionMethodReference()
           
 JsExpression rootPackageDefinitionMethodReference()
           
static JsNameRef superMethodNameRef(JsName superClassJsName)
           
 JsExpression throwClassCastExceptionFunRef()
           
static 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

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

IS_CHAR_SEQUENCE

public static final java.lang.String IS_CHAR_SEQUENCE
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

OUTER_FIELD_NAME

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

ANOTHER_THIS_PARAMETER_NAME

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

IS_ARRAY_FUN_REF

public static final JsNameRef IS_ARRAY_FUN_REF

DEFINE_INLINE_FUNCTION

public static final java.lang.String DEFINE_INLINE_FUNCTION
See Also:
Constant Field Values
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)

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 static JsExpression throwNPEFunctionRef()

throwClassCastExceptionFunRef

@NotNull
public JsExpression throwClassCastExceptionFunRef()

kotlin

@NotNull
public static JsNameRef kotlin(@NotNull
                                       JsName name)

kotlin

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

kotlinObject

@NotNull
public static JsNameRef kotlinObject()

isTypeOf

@NotNull
public JsExpression isTypeOf(@NotNull
                                     JsExpression type)

isInstanceOf

@NotNull
public JsExpression isInstanceOf(@NotNull
                                         JsExpression type)

orNull

@NotNull
public JsExpression orNull(@NotNull
                                   JsExpression callable)

andPredicate

@NotNull
public JsExpression andPredicate(@NotNull
                                         JsExpression a,
                                         @NotNull
                                         JsExpression b)

isAny

@NotNull
public JsExpression isAny()

isComparable

@NotNull
public JsExpression isComparable()

isCharSequence

@NotNull
public JsExpression isCharSequence()

isInstanceOf

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

classCreateInvocation

@NotNull
public JsExpression classCreateInvocation(@NotNull
                                                  ClassDescriptor descriptor)

getUndefinedExpression

@NotNull
public static JsExpression getUndefinedExpression()

getCallGetProperty

@NotNull
public JsExpression getCallGetProperty()

getCallSetProperty

@NotNull
public JsExpression getCallSetProperty()

getModuleReference

@NotNull
public JsExpression getModuleReference(@NotNull
                                               JsStringLiteral moduleName)

kotlinLong

public static JsNameRef kotlinLong()

createInlineFunction

@NotNull
public static JsNameRef createInlineFunction()