Package org.springframework.aot.generate
Class AccessControl
java.lang.Object
org.springframework.aot.generate.AccessControl
Determine the access control of a
Member
or type signature.- Since:
- 6.0
- Author:
- Stephane Nicoll, Phillip Webb
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
-
Method Summary
Modifier and TypeMethodDescriptionstatic AccessControl
Create anAccessControl
for the givenClass
.static AccessControl
Create anAccessControl
for the given member.static AccessControl
forResolvableType
(ResolvableType resolvableType) Create anAccessControl
for the givenResolvableType
.Return the lowestAccessControl.Visibility
of this instance.boolean
isAccessibleFrom
(org.springframework.javapoet.ClassName type) Specify whether the member or type signature backed by this instance is accessible from the specifiedClassName
.boolean
isPublic()
Return whether the member or type signature backed by ths instance is accessible from any package.static AccessControl
lowest
(AccessControl... candidates) Returns the lowestAccessControl
from the given candidates.
-
Method Details
-
forMember
Create anAccessControl
for the given member. This considers the member modifier, parameter types, return types and any enclosing classes. The lowest overallAccessControl.Visibility
is used.- Parameters:
member
- the source member- Returns:
- the
AccessControl
for the member
-
forResolvableType
Create anAccessControl
for the givenResolvableType
. This considers the type itself as well as any generics.- Parameters:
resolvableType
- the source resolvable type- Returns:
- the
AccessControl
for the type
-
forClass
Create anAccessControl
for the givenClass
.- Parameters:
type
- the source class- Returns:
- the
AccessControl
for the class
-
lowest
Returns the lowestAccessControl
from the given candidates.- Parameters:
candidates
- the candidates to check- Returns:
- the lowest
AccessControl
from the candidates
-
getVisibility
Return the lowestAccessControl.Visibility
of this instance.- Returns:
- the visibility
-
isPublic
public boolean isPublic()Return whether the member or type signature backed by ths instance is accessible from any package.- Returns:
true
if it is public
-
isAccessibleFrom
public boolean isAccessibleFrom(org.springframework.javapoet.ClassName type) Specify whether the member or type signature backed by this instance is accessible from the specifiedClassName
.- Parameters:
type
- the type to check- Returns:
true
if it is accessible
-