Top Description Inners Fields Constructors Methods
org.springframework.aot.generate

public final Class AccessControl

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Executable, .Field, .Member, .Method, .Modifier, java.util.Arrays, .HashSet, .Set, java.util.function.IntFunction, org.springframework.core.ResolvableType, org.springframework.javapoet.ClassName, org.springframework.util.Assert, .ClassUtils

Determine the access control of a Member or type signature.
Authors
Stephane Nicoll, Phillip Webb
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
AccessControl.Visibility

Access visibility types as determined by the modifiers on a Member or ResolvableType.

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final AccessControl.Visibility

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static AccessControl

Returns:

the AccessControl for the class
forClass
(Class<?>
the source class
type
)

Create an AccessControl for the given Class.

public static AccessControl

Returns:

the AccessControl for the member
forMember
(Member
the source member
member
)

Create an AccessControl for the given member.

public static AccessControl

Returns:

the AccessControl for the type
forResolvableType
(ResolvableType
the source resolvable type
resolvableType
)

Create an AccessControl for the given ResolvableType.

public AccessControl.Visibility

Returns:

the visibility
getVisibility
()

Return the lowest Visibility of this instance.

public boolean

Returns:

true if it is accessible
isAccessibleFrom
(ClassName
the type to check
type
)

Specify whether the member or type signature backed by this instance is accessible from the specified ClassName.

public boolean

Returns:

true if it is public
isPublic
()

Return whether the member or type signature backed by ths instance is accessible from any package.

public static AccessControl

Returns:

the lowest AccessControl from the candidates
lowest
(AccessControl...
the candidates to check
candidates
)

Returns the lowest AccessControl from the given candidates.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetback to summary
private final Class<?> target
visibilityback to summary
private final AccessControl.Visibility visibility

Constructor Detail

AccessControlback to summary
pack-priv AccessControl(Class<?> target, AccessControl.Visibility visibility)

Method Detail

forClassback to summary
public static AccessControl forClass(Class<?> type)

Create an AccessControl for the given Class.

Parameters
type:Class<?>

the source class

Returns:AccessControl

the AccessControl for the class

forMemberback to summary
public static AccessControl forMember(Member member)

Create an AccessControl for the given member. This considers the member modifier, parameter types, return types and any enclosing classes. The lowest overall Visibility is used.

Parameters
member:Member

the source member

Returns:AccessControl

the AccessControl for the member

forResolvableTypeback to summary
public static AccessControl forResolvableType(ResolvableType resolvableType)

Create an AccessControl for the given ResolvableType. This considers the type itself as well as any generics.

Parameters
resolvableType:ResolvableType

the source resolvable type

Returns:AccessControl

the AccessControl for the type

getVisibilityback to summary
public AccessControl.Visibility getVisibility()

Return the lowest Visibility of this instance.

Returns:AccessControl.Visibility

the visibility

isAccessibleFromback to summary
public boolean isAccessibleFrom(ClassName type)

Specify whether the member or type signature backed by this instance is accessible from the specified ClassName.

Parameters
type:ClassName

the type to check

Returns:boolean

true if it is accessible

isPublicback to summary
public boolean isPublic()

Return whether the member or type signature backed by ths instance is accessible from any package.

Returns:boolean

true if it is public

lowestback to summary
public static AccessControl lowest(AccessControl... candidates)

Returns the lowest AccessControl from the given candidates.

Parameters
candidates:AccessControl[]

the candidates to check

Returns:AccessControl

the lowest AccessControl from the candidates

org.springframework.aot.generate back to summary

public final Enum AccessControl.Visibility

extends Enum<AccessControl.Visibility>
Class Inheritance

Access visibility types as determined by the modifiers on a Member or ResolvableType.

Field Summary

Modifier and TypeField and Description
public static final AccessControl.Visibility
PACKAGE_PRIVATE

Package-private visibility.

public static final AccessControl.Visibility
PRIVATE

Private visibility.

public static final AccessControl.Visibility
PROTECTED

Protected visibility.

public static final AccessControl.Visibility
PUBLIC

Public visibility.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static AccessControl.Visibility
forClass(Class<?> clazz)

private static AccessControl.Visibility
forMember(Member member)

private static AccessControl.Visibility
forModifiers(int modifiers)

private static AccessControl.Visibility
forParameterTypes(Executable executable, IntFunction<ResolvableType> resolvableTypeFactory)

private static AccessControl.Visibility
private static AccessControl.Visibility
pack-priv static AccessControl.Visibility

Returns:

the lowest Visibility from the candidates
lowest
(AccessControl.Visibility...
the candidates to check
candidates
)

Returns the lowest Visibility from the given candidates.

pack-priv static int

Returns:

the index of the lowest Visibility from the candidates
lowestIndex
(AccessControl.Visibility...
the candidates to check
candidates
)

Returns the index of the lowest Visibility from the given candidates.

public static AccessControl.Visibility
public static AccessControl.Visibility[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

PACKAGE_PRIVATEback to summary
public static final AccessControl.Visibility PACKAGE_PRIVATE

Package-private visibility. The member or type is only visible to classes in the same package.

PRIVATEback to summary
public static final AccessControl.Visibility PRIVATE

Private visibility. The member or type is not visible to other classes.

PROTECTEDback to summary
public static final AccessControl.Visibility PROTECTED

Protected visibility. The member or type is only visible to classes in the same package or subclasses.

PUBLICback to summary
public static final AccessControl.Visibility PUBLIC

Public visibility. The member or type is visible to all classes.

Constructor Detail

Visibilityback to summary
private Visibility()

Method Detail

forClassback to summary
private static AccessControl.Visibility forClass(Class<?> clazz)
forMemberback to summary
private static AccessControl.Visibility forMember(Member member)
forModifiersback to summary
private static AccessControl.Visibility forModifiers(int modifiers)
forParameterTypesback to summary
private static AccessControl.Visibility forParameterTypes(Executable executable, IntFunction<ResolvableType> resolvableTypeFactory)
forResolvableTypeback to summary
private static AccessControl.Visibility forResolvableType(ResolvableType resolvableType)
forResolvableTypeback to summary
private static AccessControl.Visibility forResolvableType(ResolvableType resolvableType, Set<ResolvableType> seen)
lowestback to summary
pack-priv static AccessControl.Visibility lowest(AccessControl.Visibility... candidates)

Returns the lowest Visibility from the given candidates.

Parameters
candidates:AccessControl.Visibility[]

the candidates to check

Returns:AccessControl.Visibility

the lowest Visibility from the candidates

lowestIndexback to summary
pack-priv static int lowestIndex(AccessControl.Visibility... candidates)

Returns the index of the lowest Visibility from the given candidates.

Parameters
candidates:AccessControl.Visibility[]

the candidates to check

Returns:int

the index of the lowest Visibility from the candidates

valueOfback to summary
public static AccessControl.Visibility valueOf(String name)
valuesback to summary
public static AccessControl.Visibility[] values()