Class UseSite

java.lang.Object
org.revapi.Reference<JavaElement>
org.revapi.java.spi.UseSite

public final class UseSite extends org.revapi.Reference<JavaElement>
Since:
0.1
Author:
Lukas Krejci
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The way the used class is used by the use site.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    This checks if the type of the use causes the use site to be part of the API but it also checks that the site actually can cause the used type to be in the API.
     

    Methods inherited from class org.revapi.Reference

    equals, getElement, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • getType

      public UseSite.Type getType()
      Overrides:
      getType in class org.revapi.Reference<JavaElement>
    • isMovingToApi

      public boolean isMovingToApi()
      This checks if the type of the use causes the use site to be part of the API but it also checks that the site actually can cause the used type to be in the API. In particular, protected members of final classes cannot move to the API, because no outside caller can access those members.

      Implementation note: This can only be reliably used once the element forest is completely constructed. The first point when this is safe is during the element forest pruning. In particular, one cannot use this in TreeFilters because those are used during element forest construction.

      Returns:
      true if the use site moves the used type to the API, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object