Top Description Fields Constructors Methods
org.hibernate.validator.internal.engine.groups

public Class ValidationOrderGenerator

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandles, java.util.ArrayList, .Collection, .Collections, .List, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, jakarta.validation.GroupSequence, jakarta.validation.groups.Default, org.hibernate.validator.internal.util.logging.Log, .LoggerFactory

Helper class used to order groups and sequences into the right order for validation.
Authors
Hardy Ferentschik, Kevin Pollet <[email protected]> (C) 2011 SERLI

Field Summary

Modifier and TypeField and Description
private static final Log
private final ConcurrentMap<Class<?>, Sequence>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addGroups(List<Group> resolvedGroupSequence, List<Group> groups)

public ValidationOrder
getDefaultValidationOrder(Class<?> clazz, List<Class<?>> defaultGroupSequence)

public ValidationOrder

Returns:

a ValidationOrder for the given validation group
getValidationOrder
(Class<?>
the group to get as order
group
,
boolean
whether the given group should be expanded (i.e. flattened it to its members if it is a sequence or group extending another group) or not
expand
)

Creates a ValidationOrder for the given validation group.

public ValidationOrder

Returns:

an instance of ValidationOrder defining the order in which validation has to occur
getValidationOrder
(Collection<Class<?>>
the groups specified at the validation call
groups
)

Generates a order of groups and sequences for the specified validation groups.

private void
insertInheritedGroups(Class<?>
the group interface
clazz
,
DefaultValidationOrder
the group chain we are currently building
chain
)

Recursively add inherited groups into the group chain.

private void
insertSequence(Class<?> sequenceClass, Class<?>[] sequenceElements, boolean cache, DefaultValidationOrder validationOrder)

private boolean
private Sequence
resolveSequence(Class<?> sequenceClass, Class<?>[] sequenceElements, List<Class<?>> processedSequences)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

LOGback to summary
private static final Log LOG
resolvedSequencesback to summary
private final ConcurrentMap<Class<?>, Sequence> resolvedSequences

Constructor Detail

ValidationOrderGeneratorback to summary
public ValidationOrderGenerator()

Method Detail

addGroupsback to summary
private void addGroups(List<Group> resolvedGroupSequence, List<Group> groups)
getDefaultValidationOrderback to summary
public ValidationOrder getDefaultValidationOrder(Class<?> clazz, List<Class<?>> defaultGroupSequence)
getValidationOrderback to summary
public ValidationOrder getValidationOrder(Class<?> group, boolean expand)

Creates a ValidationOrder for the given validation group.

Parameters
group:Class<?>

the group to get as order

expand:boolean

whether the given group should be expanded (i.e. flattened it to its members if it is a sequence or group extending another group) or not

Returns:ValidationOrder

a ValidationOrder for the given validation group

getValidationOrderback to summary
public ValidationOrder getValidationOrder(Collection<Class<?>> groups)

Generates a order of groups and sequences for the specified validation groups.

Parameters
groups:Collection<Class<?>>

the groups specified at the validation call

Returns:ValidationOrder

an instance of ValidationOrder defining the order in which validation has to occur

insertInheritedGroupsback to summary
private void insertInheritedGroups(Class<?> clazz, DefaultValidationOrder chain)

Recursively add inherited groups into the group chain.

Parameters
clazz:Class<?>

the group interface

chain:DefaultValidationOrder

the group chain we are currently building

insertSequenceback to summary
private void insertSequence(Class<?> sequenceClass, Class<?>[] sequenceElements, boolean cache, DefaultValidationOrder validationOrder)
isGroupSequenceback to summary
private boolean isGroupSequence(Class<?> clazz)
resolveSequenceback to summary
private Sequence resolveSequence(Class<?> sequenceClass, Class<?>[] sequenceElements, List<Class<?>> processedSequences)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override