org.jetbrains.kotlin.descriptors
Class Visibility

java.lang.Object
  extended by org.jetbrains.kotlin.descriptors.Visibility

public abstract class Visibility
extends java.lang.Object


Constructor Summary
protected Visibility(java.lang.String name, boolean isPublicAPI)
           
 
Method Summary
protected  java.lang.Integer compareTo(Visibility visibility)
           
 boolean isPublicAPI()
           
protected abstract  boolean isVisible(ReceiverValue receiver, DeclarationDescriptorWithVisibility what, DeclarationDescriptor from)
           
abstract  boolean mustCheckInImports()
          True, if it makes sense to check this visibility in imports and not import inaccessible declarations with such visibility.
 Visibility normalize()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Visibility

protected Visibility(@NotNull
                     java.lang.String name,
                     boolean isPublicAPI)
Method Detail

isPublicAPI

public boolean isPublicAPI()

mustCheckInImports

public abstract boolean mustCheckInImports()
True, if it makes sense to check this visibility in imports and not import inaccessible declarations with such visibility. Hint: return true, if this visibility can be checked on file's level. Examples: it returns false for PROTECTED because protected members of classes can be imported to be used in subclasses of their containers, so when we are looking at the import, we don't know whether it is legal somewhere in this file or not. it returns true for INTERNAL, because an internal declaration is either visible everywhere in a file, or invisible everywhere in the same file. it returns true for PRIVATE, because there's no point in importing privates: they are inaccessible unless their short name is already available without an import


compareTo

protected java.lang.Integer compareTo(@NotNull
                                      Visibility visibility)
Returns:
null if the answer is unknown

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

normalize

@NotNull
public Visibility normalize()

isVisible

protected abstract boolean isVisible(@NotNull
                                     ReceiverValue receiver,
                                     @NotNull
                                     DeclarationDescriptorWithVisibility what,
                                     @NotNull
                                     DeclarationDescriptor from)