Package org.springframework.aot.generate

# Class AccessControl

java.lang.Object
org.springframework.aot.generate.AccessControl

public final class AccessControl extends Object
Determine the access control of a `Member` or type signature.

Since:
  6.0
Author:
  Stephane Nicoll, Phillip Webb

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AccessControl.Visibility`
Access visibility types as determined by the modifiers on a `Member` or `ResolvableType`.

## Method Summary

Modifier and Type
Method
Description
`static AccessControl`
`forClass(Class<?> type)`
Create an `AccessControl` for the given `Class`.
`static AccessControl`
`forMember(Member member)`
Create an `AccessControl` for the given member.
`static AccessControl`
`forResolvableType(ResolvableType resolvableType)`
Create an `AccessControl` for the given `ResolvableType`.
`AccessControl.Visibility`
`getVisibility()`
Return the lowest `AccessControl.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 specified `ClassName`.
`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 lowest `AccessControl` from the given candidates.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### forMember

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 `AccessControl.Visibility` is used.

Parameters:
  `member` - the source member
Returns:
  the `AccessControl` for the member

### forResolvableType

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` - the source resolvable type
Returns:
  the `AccessControl` for the type

### forClass

public static AccessControl forClass(Class<?> type)
Create an `AccessControl` for the given `Class`.

Parameters:
  `type` - the source class
Returns:
  the `AccessControl` for the class

### lowest

public static AccessControl lowest(AccessControl... candidates)
Returns the lowest `AccessControl` from the given candidates.

Parameters:
  `candidates` - the candidates to check
Returns:
  the lowest `AccessControl` from the candidates

### getVisibility

public AccessControl.Visibility getVisibility()
Return the lowest `AccessControl.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 specified `ClassName`.

Parameters:
  `type` - the type to check
Returns:
  `true` if it is accessible