Package org.revapi.java.spi
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 classUseSite.TypeThe way the used class is used by the use site.
-
Constructor Summary
Constructors Constructor Description UseSite(UseSite.Type useType, JavaElement site)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UseSite.TypegetType()booleanisMovingToApi()This checks if thetypeof 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.StringtoString()
-
-
-
Constructor Detail
-
UseSite
public UseSite(UseSite.Type useType, JavaElement site)
-
-
Method Detail
-
getType
public UseSite.Type getType()
- Overrides:
getTypein classorg.revapi.Reference<JavaElement>
-
isMovingToApi
public boolean isMovingToApi()
This checks if thetypeof 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:
trueif the use site moves the used type to the API,falseotherwise.
-
-