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 class
UseSite.Type
The 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.Type
getType()
boolean
isMovingToApi()
This checks if thetype
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.String
toString()
-
-
-
Constructor Detail
-
UseSite
public UseSite(UseSite.Type useType, JavaElement site)
-
-
Method Detail
-
getType
public UseSite.Type getType()
- Overrides:
getType
in classorg.revapi.Reference<JavaElement>
-
isMovingToApi
public boolean isMovingToApi()
This checks if thetype
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
TreeFilter
s because those are used during element forest construction.- Returns:
true
if the use site moves the used type to the API,false
otherwise.
-
-