Top Description Methods
org.hibernate.validator.spi.properties

public Interface GetterPropertySelectionStrategy

Known Direct Implementers
org.hibernate.validator.internal.properties.DefaultGetterPropertySelectionStrategy
Annotations
@Incubating
Imports
java.util.List, .Optional, .Set, org.hibernate.validator.Incubating

Used to define the strategy to detect the getters of a bean.

A getter is considered as being a property of the bean and thus validated when validating the bean.

Author
Marko Bekhta
Since
6.1.0

Method Summary

Modifier and TypeMethod and Description
public List<String>

Returns:

the Set of possible getter names
getGetterMethodNameCandidates
(String
a property name
propertyName
)

Gives a set of possible method names based on a property name.

public Optional<String>

Returns:

an optional containing the property corresponding to the given executable if it is considered a getter, or an empty optional otherwise
getProperty
(ConstrainableExecutable executable)

Returns the property corresponding to the getter if the method is considered a getter.

Method Detail

getGetterMethodNameCandidatesback to summary
public List<String> getGetterMethodNameCandidates(String propertyName)

Gives a set of possible method names based on a property name. Usually, it means a property name prefixed with something like "get", "is", "has" etc.

Parameters
propertyName:String

a property name

Returns:List<String>

the Set of possible getter names

getPropertyback to summary
public Optional<String> getProperty(ConstrainableExecutable executable)

Returns the property corresponding to the getter if the method is considered a getter.

Parameters
executable:ConstrainableExecutable

a ConstrainableExecutable

Returns:Optional<String>

an optional containing the property corresponding to the given executable if it is considered a getter, or an empty optional otherwise

Exceptions
IllegalArgumentException:
if a property name cannot be constructed