org.jetbrains.kotlin.descriptors.impl
Class VariableDescriptorImpl

java.lang.Object
  extended by org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
      extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
          extended by org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
              extended by org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
All Implemented Interfaces:
Annotated, CallableDescriptor, DeclarationDescriptor, DeclarationDescriptorNonRoot, DeclarationDescriptorWithSource, DeclarationDescriptorWithVisibility, Named, VariableDescriptor
Direct Known Subclasses:
ValueParameterDescriptorImpl, VariableDescriptorWithInitializerImpl

public abstract class VariableDescriptorImpl
extends DeclarationDescriptorNonRootImpl
implements VariableDescriptor


Field Summary
protected  JetType outType
           
 
Constructor Summary
VariableDescriptorImpl(DeclarationDescriptor containingDeclaration, Annotations annotations, Name name, JetType outType, SourceElement source)
           
 
Method Summary
 ReceiverParameterDescriptor getDispatchReceiverParameter()
           
 ReceiverParameterDescriptor getExtensionReceiverParameter()
           
 VariableDescriptor getOriginal()
           
 java.util.Collection<? extends CallableDescriptor> getOverriddenDescriptors()
           
 JetType getReturnType()
          Method may return null for not yet fully initialized object or if error occurred.
 JetType getType()
           
 java.util.List<TypeParameterDescriptor> getTypeParameters()
           
 java.util.List<ValueParameterDescriptor> getValueParameters()
           
 boolean hasStableParameterNames()
          Kotlin functions always have stable parameter names that can be reliably used when calling them with named arguments.
 boolean hasSynthesizedParameterNames()
          Sometimes parameter names are not available at all (e.g.
 boolean isConst()
           
 void setOutType(JetType outType)
           
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorNonRootImpl
getContainingDeclaration, getSource
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorImpl
acceptVoid, getName, toString, toString
 
Methods inherited from class org.jetbrains.kotlin.descriptors.annotations.AnnotatedImpl
getAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.VariableDescriptor
getCompileTimeInitializer, getContainingDeclaration, isVar, substitute
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility
getVisibility
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
getSource
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptor
accept, acceptVoid
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.annotations.Annotated
getAnnotations
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.Named
getName
 

Field Detail

outType

protected JetType outType
Constructor Detail

VariableDescriptorImpl

public VariableDescriptorImpl(@NotNull
                              DeclarationDescriptor containingDeclaration,
                              @NotNull
                              Annotations annotations,
                              @NotNull
                              Name name,
                              @Nullable
                              JetType outType,
                              @NotNull
                              SourceElement source)
Method Detail

getType

@NotNull
public JetType getType()
Specified by:
getType in interface VariableDescriptor

setOutType

public void setOutType(JetType outType)

getOriginal

@NotNull
public VariableDescriptor getOriginal()
Specified by:
getOriginal in interface CallableDescriptor
Specified by:
getOriginal in interface DeclarationDescriptor
Specified by:
getOriginal in interface DeclarationDescriptorWithSource
Overrides:
getOriginal in class DeclarationDescriptorNonRootImpl
Returns:
The descriptor that corresponds to the original declaration of this element. A descriptor can be obtained from its original by substituting type arguments (of the declaring class or of the element itself). returns this object if the current descriptor is original itself

getValueParameters

@NotNull
public java.util.List<ValueParameterDescriptor> getValueParameters()
Specified by:
getValueParameters in interface CallableDescriptor

hasStableParameterNames

public boolean hasStableParameterNames()
Description copied from interface: CallableDescriptor
Kotlin functions always have stable parameter names that can be reliably used when calling them with named arguments. Functions loaded from platform definitions (e.g. Java binaries or JS) may have unstable parameter names that vary from one platform installation to another. These names can not be used reliably for calls with named arguments.

Specified by:
hasStableParameterNames in interface CallableDescriptor

hasSynthesizedParameterNames

public boolean hasSynthesizedParameterNames()
Description copied from interface: CallableDescriptor
Sometimes parameter names are not available at all (e.g. Java binaries with not enough debug information). In this case, getName() returns synthetic names such as "p0", "p1" etc.

Specified by:
hasSynthesizedParameterNames in interface CallableDescriptor

getOverriddenDescriptors

@NotNull
public java.util.Collection<? extends CallableDescriptor> getOverriddenDescriptors()
Specified by:
getOverriddenDescriptors in interface CallableDescriptor

getTypeParameters

@NotNull
public java.util.List<TypeParameterDescriptor> getTypeParameters()
Specified by:
getTypeParameters in interface CallableDescriptor

getExtensionReceiverParameter

public ReceiverParameterDescriptor getExtensionReceiverParameter()
Specified by:
getExtensionReceiverParameter in interface CallableDescriptor

getDispatchReceiverParameter

public ReceiverParameterDescriptor getDispatchReceiverParameter()
Specified by:
getDispatchReceiverParameter in interface CallableDescriptor

getReturnType

@NotNull
public JetType getReturnType()
Description copied from interface: CallableDescriptor
Method may return null for not yet fully initialized object or if error occurred.

Specified by:
getReturnType in interface CallableDescriptor

isConst

public boolean isConst()
Specified by:
isConst in interface VariableDescriptor
Returns:
true if iff original declaration has appropriate flags and type, e.g. `const` modifier in Kotlin. It completely does not means that if isConst then `getCompileTimeInitializer` is not null