Top Description Inners Constructors Methods
org.springframework.aot.hint.predicate

public Class ReflectionHintsPredicates

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Executable, .Field, .Method, .Modifier, java.util.Arrays, .List, .Set, java.util.function.Predicate, org.springframework.aot.hint.ExecutableHint, .ExecutableMode, .MemberCategory, .ReflectionHints, .RuntimeHints, .TypeHint, .TypeReference, org.springframework.core.MethodIntrospector, org.springframework.lang.Nullable, org.springframework.util.Assert, .ReflectionUtils

Generator of ReflectionHints predicates, testing whether the given hints match the expected behavior for reflection.
Authors
Brian Clozel, Stephane Nicoll
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public abstract static class
public static class
public static class
public static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private Method
getMethod(Class<?> type, String methodName)

public ReflectionHintsPredicates.ConstructorHintPredicate

Returns:

the RuntimeHints predicate
onConstructor
(Constructor<?>
the constructor
constructor
)

Return a predicate that checks whether a reflection hint is registered for the given constructor.

public ReflectionHintsPredicates.FieldHintPredicate

Returns:

the RuntimeHints predicate
onField
(Class<?>
the type holding the field
type
,
String
the field name
fieldName
)

Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector.

public ReflectionHintsPredicates.FieldHintPredicate

Returns:

the RuntimeHints predicate
onField
(String
the name of the class holding the field
className
,
String
the field name
fieldName
)

Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector.

public ReflectionHintsPredicates.FieldHintPredicate

Returns:

the RuntimeHints predicate
onField
(Field
the field
field
)

Return a predicate that checks whether a reflection hint is registered for the given field.

public ReflectionHintsPredicates.MethodHintPredicate

Returns:

the RuntimeHints predicate
onMethod
(Method
the method
method
)

Return a predicate that checks whether a reflection hint is registered for the given method.

public ReflectionHintsPredicates.MethodHintPredicate

Returns:

the RuntimeHints predicate
onMethod
(Class<?>
the type holding the method
type
,
String
the method name
methodName
)

Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector.

public ReflectionHintsPredicates.MethodHintPredicate

Returns:

the RuntimeHints predicate
onMethod
(String
the name of the class holding the method
className
,
String
the method name
methodName
)

Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector.

public ReflectionHintsPredicates.TypeHintPredicate

Returns:

the RuntimeHints predicate
onType
(TypeReference
the type
typeReference
)

Return a predicate that checks whether a reflection hint is registered for the given type.

public ReflectionHintsPredicates.TypeHintPredicate

Returns:

the RuntimeHints predicate
onType
(Class<?>
the type
type
)

Return a predicate that checks whether a reflection hint is registered for the given type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ReflectionHintsPredicatesback to summary
pack-priv ReflectionHintsPredicates()

Method Detail

getMethodback to summary
private Method getMethod(Class<?> type, String methodName)
onConstructorback to summary
public ReflectionHintsPredicates.ConstructorHintPredicate onConstructor(Constructor<?> constructor)

Return a predicate that checks whether a reflection hint is registered for the given constructor. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
constructor:Constructor<?>

the constructor

Returns:ReflectionHintsPredicates.ConstructorHintPredicate

the RuntimeHints predicate

onFieldback to summary
public ReflectionHintsPredicates.FieldHintPredicate onField(Class<?> type, String fieldName)

Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector. This looks up a field on the given type with the expected name, if present. By default, unsafe or write access is not considered.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
type:Class<?>

the type holding the field

fieldName:String

the field name

Returns:ReflectionHintsPredicates.FieldHintPredicate

the RuntimeHints predicate

Exceptions
IllegalArgumentException:
if a field cannot be found with the given name.
onFieldback to summary
public ReflectionHintsPredicates.FieldHintPredicate onField(String className, String fieldName) throws ClassNotFoundException

Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector. This looks up a field on the given type with the expected name, if present. By default, unsafe or write access is not considered.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
className:String

the name of the class holding the field

fieldName:String

the field name

Returns:ReflectionHintsPredicates.FieldHintPredicate

the RuntimeHints predicate

Exceptions
ClassNotFoundException:
if the class cannot be resolved.
IllegalArgumentException:
if a field cannot be found with the given name.
onFieldback to summary
public ReflectionHintsPredicates.FieldHintPredicate onField(Field field)

Return a predicate that checks whether a reflection hint is registered for the given field. By default, unsafe or write access is not considered.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
field:Field

the field

Returns:ReflectionHintsPredicates.FieldHintPredicate

the RuntimeHints predicate

onMethodback to summary
public ReflectionHintsPredicates.MethodHintPredicate onMethod(Method method)

Return a predicate that checks whether a reflection hint is registered for the given method. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
method:Method

the method

Returns:ReflectionHintsPredicates.MethodHintPredicate

the RuntimeHints predicate

onMethodback to summary
public ReflectionHintsPredicates.MethodHintPredicate onMethod(Class<?> type, String methodName)

Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector. This looks up a method on the given type with the expected name, if unique. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
type:Class<?>

the type holding the method

methodName:String

the method name

Returns:ReflectionHintsPredicates.MethodHintPredicate

the RuntimeHints predicate

Exceptions
IllegalArgumentException:
if the method cannot be found or if multiple methods are found with the same name.
onMethodback to summary
public ReflectionHintsPredicates.MethodHintPredicate onMethod(String className, String methodName) throws ClassNotFoundException

Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector. This looks up a method on the given type with the expected name, if unique. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
className:String

the name of the class holding the method

methodName:String

the method name

Returns:ReflectionHintsPredicates.MethodHintPredicate

the RuntimeHints predicate

Exceptions
ClassNotFoundException:
if the class cannot be resolved.
IllegalArgumentException:
if the method cannot be found or if multiple methods are found with the same name.
onTypeback to summary
public ReflectionHintsPredicates.TypeHintPredicate onType(TypeReference typeReference)

Return a predicate that checks whether a reflection hint is registered for the given type.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
typeReference:TypeReference

the type

Returns:ReflectionHintsPredicates.TypeHintPredicate

the RuntimeHints predicate

onTypeback to summary
public ReflectionHintsPredicates.TypeHintPredicate onType(Class<?> type)

Return a predicate that checks whether a reflection hint is registered for the given type.

The returned type exposes additional methods that refine the predicate behavior.

Parameters
type:Class<?>

the type

Returns:ReflectionHintsPredicates.TypeHintPredicate

the RuntimeHints predicate

org.springframework.aot.hint.predicate back to summary

public Class ReflectionHintsPredicates.ConstructorHintPredicate

extends ReflectionHintsPredicates.ExecutableHintPredicate<Constructor<?>>
Class Inheritance

Field Summary

Inherited from org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate:
executableexecutableMode

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Predicate<RuntimeHints>
pack-priv MemberCategory[]
pack-priv MemberCategory[]
public boolean
test(RuntimeHints
the input argument
runtimeHints
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.
Inherited from org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate:
includesintrospectinvoke

Constructor Detail

ConstructorHintPredicateback to summary
pack-priv ConstructorHintPredicate(Constructor<?> constructor)

Method Detail

exactMatchback to summary
pack-priv Predicate<RuntimeHints> exactMatch()

Implements abstract org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate.exactMatch.

Annotations
@Override
getDeclaredMemberCategoriesback to summary
pack-priv MemberCategory[] getDeclaredMemberCategories()
getPublicMemberCategoriesback to summary
pack-priv MemberCategory[] getPublicMemberCategories()
testback to summary
public boolean test(RuntimeHints runtimeHints)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
runtimeHints:RuntimeHints

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override
org.springframework.aot.hint.predicate back to summary

public abstract Class ReflectionHintsPredicates.ExecutableHintPredicate<T extends java.lang.reflect.Executable>

extends Object
implements Predicate<RuntimeHints>
Class Inheritance
  • java.lang.Object
  • org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate
All Implemented Interfaces
java.util.function.Predicate
Known Direct Subclasses
org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ConstructorHintPredicate, org.springframework.aot.hint.predicate.ReflectionHintsPredicates.MethodHintPredicate

Field Summary

Modifier and TypeField and Description
protected final T
protected ExecutableMode

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract Predicate<RuntimeHints>
pack-priv static boolean

Returns:

true if the member matches (same type, name, and parameters), and the configured ExecutableMode is compatible
includes
(ExecutableHint hint, String name, List<TypeReference> parameterTypes, ExecutableMode executableModes)

Indicate whether the specified ExecutableHint covers the reflection needs of the specified executable definition.

public ReflectionHintsPredicates.ExecutableHintPredicate<T>

Returns:

the refined RuntimeHints predicate
introspect
()

Refine the current predicate to match for reflection introspection on the current type.

public ReflectionHintsPredicates.ExecutableHintPredicate<T>

Returns:

the refined RuntimeHints predicate
invoke
()

Refine the current predicate to match for reflection invocation on the current type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executableback to summary
protected final T executable
executableModeback to summary
protected ExecutableMode executableMode

Constructor Detail

ExecutableHintPredicateback to summary
pack-priv ExecutableHintPredicate(T executable)

Method Detail

exactMatchback to summary
pack-priv abstract Predicate<RuntimeHints> exactMatch()
includesback to summary
pack-priv static boolean includes(ExecutableHint hint, String name, List<TypeReference> parameterTypes, ExecutableMode executableModes)

Indicate whether the specified ExecutableHint covers the reflection needs of the specified executable definition.

Returns:boolean

true if the member matches (same type, name, and parameters), and the configured ExecutableMode is compatible

introspectback to summary
public ReflectionHintsPredicates.ExecutableHintPredicate<T> introspect()

Refine the current predicate to match for reflection introspection on the current type.

Returns:ReflectionHintsPredicates.ExecutableHintPredicate<T>

the refined RuntimeHints predicate

invokeback to summary
public ReflectionHintsPredicates.ExecutableHintPredicate<T> invoke()

Refine the current predicate to match for reflection invocation on the current type.

Returns:ReflectionHintsPredicates.ExecutableHintPredicate<T>

the refined RuntimeHints predicate

org.springframework.aot.hint.predicate back to summary

public Class ReflectionHintsPredicates.FieldHintPredicate

extends Object
implements Predicate<RuntimeHints>
Class Inheritance
  • java.lang.Object
  • org.springframework.aot.hint.predicate.ReflectionHintsPredicates.FieldHintPredicate
All Implemented Interfaces
java.util.function.Predicate

Field Summary

Modifier and TypeField and Description
private final Field

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
exactMatch(TypeHint typeHint)

private boolean
public boolean
test(RuntimeHints
the input argument
runtimeHints
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldback to summary
private final Field field

Constructor Detail

FieldHintPredicateback to summary
pack-priv FieldHintPredicate(Field field)

Method Detail

exactMatchback to summary
private boolean exactMatch(TypeHint typeHint)
memberCategoryMatchback to summary
private boolean memberCategoryMatch(TypeHint typeHint)
testback to summary
public boolean test(RuntimeHints runtimeHints)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
runtimeHints:RuntimeHints

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override
org.springframework.aot.hint.predicate back to summary

public Class ReflectionHintsPredicates.MethodHintPredicate

extends ReflectionHintsPredicates.ExecutableHintPredicate<Method>
Class Inheritance

Field Summary

Inherited from org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate:
executableexecutableMode

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Predicate<RuntimeHints>
pack-priv MemberCategory[]
pack-priv MemberCategory[]
public boolean
test(RuntimeHints
the input argument
runtimeHints
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.
Inherited from org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate:
includesintrospectinvoke

Constructor Detail

MethodHintPredicateback to summary
pack-priv MethodHintPredicate(Method method)

Method Detail

exactMatchback to summary
pack-priv Predicate<RuntimeHints> exactMatch()

Implements abstract org.springframework.aot.hint.predicate.ReflectionHintsPredicates.ExecutableHintPredicate.exactMatch.

Annotations
@Override
getDeclaredMemberCategoriesback to summary
pack-priv MemberCategory[] getDeclaredMemberCategories()
getPublicMemberCategoriesback to summary
pack-priv MemberCategory[] getPublicMemberCategories()
testback to summary
public boolean test(RuntimeHints runtimeHints)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
runtimeHints:RuntimeHints

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override
org.springframework.aot.hint.predicate back to summary

public Class ReflectionHintsPredicates.TypeHintPredicate

extends Object
implements Predicate<RuntimeHints>
Class Inheritance
  • java.lang.Object
  • org.springframework.aot.hint.predicate.ReflectionHintsPredicates.TypeHintPredicate
All Implemented Interfaces
java.util.function.Predicate

Field Summary

Modifier and TypeField and Description
private final TypeReference

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private TypeHint
public boolean
test(RuntimeHints
the input argument
hints
)

Implements java.util.function.Predicate.test.

Evaluates this predicate on the given argument.
public Predicate<RuntimeHints>

Returns:

the refined RuntimeHints predicate
withAnyMemberCategory
(MemberCategory...
the member categories
memberCategories
)

Refine the current predicate to match if any of the given categories is present.

public Predicate<RuntimeHints>

Returns:

the refined RuntimeHints predicate
withMemberCategories
(MemberCategory...
the member categories
memberCategories
)

Refine the current predicate to only match if the given categories are present.

public Predicate<RuntimeHints>

Returns:

the refined RuntimeHints predicate
withMemberCategory
(MemberCategory
the member category
memberCategory
)

Refine the current predicate to only match if the given MemberCategory is present.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

typeback to summary
private final TypeReference type

Constructor Detail

TypeHintPredicateback to summary
pack-priv TypeHintPredicate(TypeReference type)

Method Detail

getTypeHintback to summary
private TypeHint getTypeHint(RuntimeHints hints)
Annotations
@Nullable
testback to summary
public boolean test(RuntimeHints hints)

Implements java.util.function.Predicate.test.

Doc from java.util.function.Predicate.test.

Evaluates this predicate on the given argument.

Parameters
hints:RuntimeHints

the input argument

Returns:boolean

true if the input argument matches the predicate, otherwise false

Annotations
@Override
withAnyMemberCategoryback to summary
public Predicate<RuntimeHints> withAnyMemberCategory(MemberCategory... memberCategories)

Refine the current predicate to match if any of the given categories is present.

Parameters
memberCategories:MemberCategory[]

the member categories

Returns:Predicate<RuntimeHints>

the refined RuntimeHints predicate

withMemberCategoriesback to summary
public Predicate<RuntimeHints> withMemberCategories(MemberCategory... memberCategories)

Refine the current predicate to only match if the given categories are present.

Parameters
memberCategories:MemberCategory[]

the member categories

Returns:Predicate<RuntimeHints>

the refined RuntimeHints predicate

withMemberCategoryback to summary
public Predicate<RuntimeHints> withMemberCategory(MemberCategory memberCategory)

Refine the current predicate to only match if the given MemberCategory is present.

Parameters
memberCategory:MemberCategory

the member category

Returns:Predicate<RuntimeHints>

the refined RuntimeHints predicate