org.jetbrains.kotlin.descriptors.impl
Class PropertyDescriptorImpl

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
                  extended by org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
All Implemented Interfaces:
Annotated, CallableDescriptor, CallableMemberDescriptor, DeclarationDescriptor, DeclarationDescriptorNonRoot, DeclarationDescriptorWithSource, DeclarationDescriptorWithVisibility, MemberDescriptor, Named, PropertyDescriptor, VariableDescriptor
Direct Known Subclasses:
AccessorForPropertyDescriptor, JavaPropertyDescriptor

public class PropertyDescriptorImpl
extends VariableDescriptorImpl
implements PropertyDescriptor


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
CallableMemberDescriptor.Kind
 
Constructor Summary
protected PropertyDescriptorImpl(DeclarationDescriptor containingDeclaration, PropertyDescriptor original, Annotations annotations, Modality modality, Visibility visibility, boolean isVar, Name name, CallableMemberDescriptor.Kind kind, SourceElement source)
           
 
Method Summary
<R,D> R
accept(DeclarationDescriptorVisitor<R,D> visitor, D data)
           
 void addOverriddenDescriptor(CallableMemberDescriptor overridden)
           
 PropertyDescriptor copy(DeclarationDescriptor newOwner, Modality modality, Visibility visibility, CallableMemberDescriptor.Kind kind, boolean copyOverrides)
           
static PropertyDescriptorImpl create(DeclarationDescriptor containingDeclaration, Annotations annotations, Modality modality, Visibility visibility, boolean isVar, Name name, CallableMemberDescriptor.Kind kind, SourceElement source)
           
protected  PropertyDescriptorImpl createSubstitutedCopy(DeclarationDescriptor newOwner, Modality newModality, Visibility newVisibility, PropertyDescriptor original, CallableMemberDescriptor.Kind kind)
           
 java.util.List<PropertyAccessorDescriptor> getAccessors()
           
 ReceiverParameterDescriptor getDispatchReceiverParameter()
           
 ReceiverParameterDescriptor getExtensionReceiverParameter()
           
 PropertyGetterDescriptorImpl getGetter()
           
 CallableMemberDescriptor.Kind getKind()
          Is this a real function or function projection.
 Modality getModality()
           
 PropertyDescriptor getOriginal()
           
 java.util.Set<? extends PropertyDescriptor> getOverriddenDescriptors()
           
 JetType getReturnType()
          Method may return null for not yet fully initialized object or if error occurred.
 PropertySetterDescriptor getSetter()
           
 java.util.List<TypeParameterDescriptor> getTypeParameters()
           
 Visibility getVisibility()
           
 void initialize(PropertyGetterDescriptorImpl getter, PropertySetterDescriptor setter)
           
 boolean isSetterProjectedOut()
          In the following case, the setter is projected out: trait Tr { var v: T } fun test(tr: Tr) { tr.v = null!! // the assignment is illegal, although a read would be fine }
 boolean isVar()
           
 void setSetterProjectedOut(boolean setterProjectedOut)
           
 void setType(JetType outType, java.util.List<? extends TypeParameterDescriptor> typeParameters, ReceiverParameterDescriptor dispatchReceiverParameter, JetType receiverType)
           
 void setType(JetType outType, java.util.List<? extends TypeParameterDescriptor> typeParameters, ReceiverParameterDescriptor dispatchReceiverParameter, ReceiverParameterDescriptor extensionReceiverParameter)
           
 void setVisibility(Visibility visibility)
           
 PropertyDescriptor substitute(TypeSubstitutor originalSubstitutor)
           
 
Methods inherited from class org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl
getCompileTimeInitializer, getType, getValueParameters, hasStableParameterNames, hasSynthesizedParameterNames, setCompileTimeInitializer, setOutType
 
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
 
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, getType
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.CallableDescriptor
getValueParameters, hasStableParameterNames, hasSynthesizedParameterNames
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
getSource
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.DeclarationDescriptor
acceptVoid
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.annotations.Annotated
getAnnotations
 
Methods inherited from interface org.jetbrains.kotlin.descriptors.Named
getName
 

Constructor Detail

PropertyDescriptorImpl

protected PropertyDescriptorImpl(@NotNull
                                 DeclarationDescriptor containingDeclaration,
                                 @Nullable
                                 PropertyDescriptor original,
                                 @NotNull
                                 Annotations annotations,
                                 @NotNull
                                 Modality modality,
                                 @NotNull
                                 Visibility visibility,
                                 boolean isVar,
                                 @NotNull
                                 Name name,
                                 @NotNull
                                 CallableMemberDescriptor.Kind kind,
                                 @NotNull
                                 SourceElement source)
Method Detail

create

@NotNull
public static PropertyDescriptorImpl create(@NotNull
                                                    DeclarationDescriptor containingDeclaration,
                                                    @NotNull
                                                    Annotations annotations,
                                                    @NotNull
                                                    Modality modality,
                                                    @NotNull
                                                    Visibility visibility,
                                                    boolean isVar,
                                                    @NotNull
                                                    Name name,
                                                    @NotNull
                                                    CallableMemberDescriptor.Kind kind,
                                                    @NotNull
                                                    SourceElement source)

setType

public void setType(@NotNull
                    JetType outType,
                    @NotNull
                    java.util.List<? extends TypeParameterDescriptor> typeParameters,
                    @Nullable
                    ReceiverParameterDescriptor dispatchReceiverParameter,
                    @Nullable
                    JetType receiverType)

setType

public void setType(@NotNull
                    JetType outType,
                    @NotNull
                    java.util.List<? extends TypeParameterDescriptor> typeParameters,
                    @Nullable
                    ReceiverParameterDescriptor dispatchReceiverParameter,
                    @Nullable
                    ReceiverParameterDescriptor extensionReceiverParameter)

initialize

public void initialize(@Nullable
                       PropertyGetterDescriptorImpl getter,
                       @Nullable
                       PropertySetterDescriptor setter)

setSetterProjectedOut

public void setSetterProjectedOut(boolean setterProjectedOut)

setVisibility

public void setVisibility(@NotNull
                          Visibility visibility)

getTypeParameters

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

getExtensionReceiverParameter

@Nullable
public ReceiverParameterDescriptor getExtensionReceiverParameter()
Specified by:
getExtensionReceiverParameter in interface CallableDescriptor
Overrides:
getExtensionReceiverParameter in class VariableDescriptorImpl

getDispatchReceiverParameter

@Nullable
public ReceiverParameterDescriptor getDispatchReceiverParameter()
Specified by:
getDispatchReceiverParameter in interface CallableDescriptor
Overrides:
getDispatchReceiverParameter in class VariableDescriptorImpl

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
Overrides:
getReturnType in class VariableDescriptorImpl

isVar

public boolean isVar()
Specified by:
isVar in interface VariableDescriptor

getModality

@NotNull
public Modality getModality()
Specified by:
getModality in interface MemberDescriptor

getVisibility

@NotNull
public Visibility getVisibility()
Specified by:
getVisibility in interface DeclarationDescriptorWithVisibility
Specified by:
getVisibility in interface MemberDescriptor

getGetter

@Nullable
public PropertyGetterDescriptorImpl getGetter()
Specified by:
getGetter in interface PropertyDescriptor

getSetter

@Nullable
public PropertySetterDescriptor getSetter()
Specified by:
getSetter in interface PropertyDescriptor

isSetterProjectedOut

public boolean isSetterProjectedOut()
Description copied from interface: PropertyDescriptor
In the following case, the setter is projected out: trait Tr { var v: T } fun test(tr: Tr) { tr.v = null!! // the assignment is illegal, although a read would be fine }

Specified by:
isSetterProjectedOut in interface PropertyDescriptor

getAccessors

@NotNull
public java.util.List<PropertyAccessorDescriptor> getAccessors()
Specified by:
getAccessors in interface PropertyDescriptor

substitute

public PropertyDescriptor substitute(@NotNull
                                     TypeSubstitutor originalSubstitutor)
Specified by:
substitute in interface CallableDescriptor
Specified by:
substitute in interface DeclarationDescriptor
Specified by:
substitute in interface PropertyDescriptor
Specified by:
substitute in interface VariableDescriptor

createSubstitutedCopy

@NotNull
protected PropertyDescriptorImpl createSubstitutedCopy(@NotNull
                                                               DeclarationDescriptor newOwner,
                                                               @NotNull
                                                               Modality newModality,
                                                               @NotNull
                                                               Visibility newVisibility,
                                                               @Nullable
                                                               PropertyDescriptor original,
                                                               @NotNull
                                                               CallableMemberDescriptor.Kind kind)

accept

public <R,D> R accept(DeclarationDescriptorVisitor<R,D> visitor,
                      D data)
Specified by:
accept in interface DeclarationDescriptor

getOriginal

@NotNull
public PropertyDescriptor getOriginal()
Specified by:
getOriginal in interface CallableDescriptor
Specified by:
getOriginal in interface CallableMemberDescriptor
Specified by:
getOriginal in interface DeclarationDescriptor
Specified by:
getOriginal in interface PropertyDescriptor
Overrides:
getOriginal in class VariableDescriptorImpl
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

getKind

@NotNull
public CallableMemberDescriptor.Kind getKind()
Description copied from interface: CallableMemberDescriptor
Is this a real function or function projection.

Specified by:
getKind in interface CallableMemberDescriptor

addOverriddenDescriptor

public void addOverriddenDescriptor(@NotNull
                                    CallableMemberDescriptor overridden)
Specified by:
addOverriddenDescriptor in interface CallableMemberDescriptor

getOverriddenDescriptors

@NotNull
public java.util.Set<? extends PropertyDescriptor> getOverriddenDescriptors()
Specified by:
getOverriddenDescriptors in interface CallableDescriptor
Specified by:
getOverriddenDescriptors in interface CallableMemberDescriptor
Specified by:
getOverriddenDescriptors in interface PropertyDescriptor
Overrides:
getOverriddenDescriptors in class VariableDescriptorImpl

copy

@NotNull
public PropertyDescriptor copy(DeclarationDescriptor newOwner,
                                       Modality modality,
                                       Visibility visibility,
                                       CallableMemberDescriptor.Kind kind,
                                       boolean copyOverrides)
Specified by:
copy in interface CallableMemberDescriptor