Instances are retrieved by creating a Builder and adding all required
ConstrainedExecutable objects to it. Instances are read-only after
creation.
Identity is solely based on the method's name and parameter types, hence sets and similar collections of this type may only be created in the scope of one Java type.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ExecutableMetaData.Builder
Creates new |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final boolean | |
| private final ElementKind | |
| private final List | |
| private final Class | |
| private final ReturnValueMetaData | |
| private final Set | signatures
Set of signatures for storing this object in maps etc. Will only contain more than one entry in case this method overrides a super type method with generic parameters, in which case the signature of the super-type and the sub-type method will differ. |
| private final ValidatableParametersMetaData |
| Access | Constructor and Description |
|---|---|
| private | ExecutableMetaData(String name, Type returnType, Class<?>[] parameterTypes, ElementKind kind, Set<Signature> signatures, Set<MetaConstraint<?>> returnValueConstraints, Set<MetaConstraint<?>> returnValueContainerElementConstraints, List<ParameterMetaData> parameterMetaDataList, Set<MetaConstraint<?>> crossParameterConstraints, CascadingMetaData cascadingMetaData, boolean isConstrained, boolean isGetter)
|
| Modifier and Type | Method and Description |
|---|---|
| public ExecutableDescriptorImpl | asDescriptor(boolean
Whether the bean hosting the represented element has a
redefined default group sequence or not. defaultGroupSequenceRedefined, List<Class<?>> The default group sequence of the bean hosting the represented
element. defaultGroupSequence)Implements org. |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides org. |
| public Set | Returns: the cross-parameter constraints declared for the represented method or constructor. May be empty but will never benull.Returns the cross-parameter constraints declared for the represented method or constructor. |
| public ElementKind | getKind()
Implements org. kind of this meta data object.
|
| public ParameterMetaData | Returns: Meta data for the specified parameter. Will never benull.the index of the parameter parameterIndex)Returns meta data for the specified parameter of the represented executable. |
| public Class | |
| public ReturnValueMetaData | |
| public Set | Returns: The signatures of this meta data object. Will only contain more than one element in case the represented method represents a sub-type method overriding a super-type method using a generic type parameter in its parameters.Returns the signature(s) of the method represented by this meta data object, based on the represented executable's name and its parameter types. |
| public ValidatableParametersMetaData | |
| public int | hashCode()
Overrides org. |
| private List | |
| public String | toString()
Overrides org. |
| crossParameterConstraints | back to summary |
|---|---|
| private final Set<MetaConstraint<?>> crossParameterConstraints
| |
| isGetter | back to summary |
|---|---|
| private final boolean isGetter | |
| kind | back to summary |
|---|---|
| private final ElementKind kind | |
| parameterMetaDataList | back to summary |
|---|---|
| private final List<ParameterMetaData> parameterMetaDataList
| |
| parameterTypes | back to summary |
|---|---|
| private final Class<?>[] parameterTypes | |
| returnValueMetaData | back to summary |
|---|---|
| private final ReturnValueMetaData returnValueMetaData | |
| signatures | back to summary |
|---|---|
| private final Set<Signature> signatures Set of signatures for storing this object in maps etc. Will only contain more than one entry in case this method overrides a super type method with generic parameters, in which case the signature of the super-type and the sub-type method will differ. | |
| validatableParametersMetaData | back to summary |
|---|---|
| private final ValidatableParametersMetaData validatableParametersMetaData | |
| ExecutableMetaData | back to summary |
|---|---|
| private ExecutableMetaData(String name, Type returnType, Class<?>[] parameterTypes, ElementKind kind, Set<Signature> signatures, Set<MetaConstraint<?>> returnValueConstraints, Set<MetaConstraint<?>> returnValueContainerElementConstraints, List<ParameterMetaData> parameterMetaDataList, Set<MetaConstraint<?>> crossParameterConstraints, CascadingMetaData cascadingMetaData, boolean isConstrained, boolean isGetter) | |
| asDescriptor | back to summary |
|---|---|
| public ExecutableDescriptorImpl asDescriptor(boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence) Implements org. Doc from org. Returns this meta data object's corresponding representation in the descriptor model.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides org. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCrossParameterConstraints | back to summary |
|---|---|
| public Set Returns the cross-parameter constraints declared for the represented method or constructor.
| |
| getKind | back to summary |
|---|---|
| public ElementKind getKind() Implements org. Doc from org. Returns the
| |
| getParameterMetaData | back to summary |
|---|---|
| public ParameterMetaData getParameterMetaData(int parameterIndex) Returns meta data for the specified parameter of the represented executable.
| |
| getParameterTypes | back to summary |
|---|---|
| public Class | |
| getReturnValueMetaData | back to summary |
|---|---|
| public ReturnValueMetaData getReturnValueMetaData() | |
| getSignatures | back to summary |
|---|---|
| public Set Returns the signature(s) of the method represented by this meta data object, based on the represented executable's name and its parameter types. | |
| getValidatableParametersMetaData | back to summary |
|---|---|
| public ValidatableParametersMetaData getValidatableParametersMetaData() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides org. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| parametersAsDescriptors | back to summary |
|---|---|
| private List | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |
ExecutableMetaData instances.
| Modifier and Type | Field and Description |
|---|---|
| private Callable | |
| private CascadingMetaDataBuilder | |
| private final Set | |
| private final Set | |
| private final ExecutableHelper | |
| private final Map | executablesByDeclaringType
Holds a merged representation of the configurations for one method from the hierarchy contributed by the different meta data providers. |
| private boolean | |
| private final ConstrainedElement. | kind
Either CONSTRUCTOR, METHOD or GETTER. |
| private final ExecutableParameterNameProvider | |
| private final Set | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public | Builder(Class<?> beanClass, ConstrainedExecutable constrainedExecutable, ConstraintCreationContext constraintCreationContext, ExecutableHelper executableHelper, ExecutableParameterNameProvider parameterNameProvider, MethodValidationConfiguration methodValidationConfiguration)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | accepts(ConstrainedElement
The element to check. constrainedElement)Implements abstract org. |
| public final void | add(ConstrainedElement
The element to add. constrainedElement)Overrides org. |
| private void | addToExecutablesByDeclaringType(ConstrainedExecutable
The executable to merge. executable)Merges the given executable with the metadata contributed by other providers for the same executable in the hierarchy. |
| private void | assertCorrectnessOfConfiguration()
Checks the configuration of this method for correctness as per the rules outlined in the Bean Validation specification, section 4.5.5 ("Method constraints in inheritance hierarchies"). |
| public ExecutableMetaData | build()
Implements abstract org. ConstraintMetaData object with all
constraint information related to the method or property represented by
this builder.
|
| private List | Returns: The parameter meta data for this builder's executable.Finds the one executable from the underlying hierarchy with parameter constraints. |
| private boolean | |
| private boolean | |
| private boolean |
| callable | back to summary |
|---|---|
| private Callable callable | |
| cascadingMetaDataBuilder | back to summary |
|---|---|
| private CascadingMetaDataBuilder cascadingMetaDataBuilder | |
| constrainedExecutables | back to summary |
|---|---|
| private final Set<ConstrainedExecutable> constrainedExecutables | |
| crossParameterConstraints | back to summary |
|---|---|
| private final Set<MetaConstraint<?>> crossParameterConstraints | |
| executableHelper | back to summary |
|---|---|
| private final ExecutableHelper executableHelper | |
| executablesByDeclaringType | back to summary |
|---|---|
| private final Map<Class<?>, ConstrainedExecutable> executablesByDeclaringType Holds a merged representation of the configurations for one method from the hierarchy contributed by the different meta data providers. Used to check for violations of the Liskov substitution principle by e.g. adding parameter constraints in sub type methods. | |
| isConstrained | back to summary |
|---|---|
| private boolean isConstrained | |
| kind | back to summary |
|---|---|
| private final ConstrainedElement. Either CONSTRUCTOR, METHOD or GETTER. | |
| parameterNameProvider | back to summary |
|---|---|
| private final ExecutableParameterNameProvider parameterNameProvider | |
| rules | back to summary |
|---|---|
| private final Set<MethodConfigurationRule> rules | |
| signatures | back to summary |
|---|---|
| private final Set<Signature> signatures | |
| Builder | back to summary |
|---|---|
| public Builder(Class<?> beanClass, ConstrainedExecutable constrainedExecutable, ConstraintCreationContext constraintCreationContext, ExecutableHelper executableHelper, ExecutableParameterNameProvider parameterNameProvider, MethodValidationConfiguration methodValidationConfiguration) | |
| accepts | back to summary |
|---|---|
| public boolean accepts(ConstrainedElement constrainedElement) Implements abstract org. Doc from org. Whether this builder allows to add the given element or not. This is the case if the specified element relates to the same property or method with which this builder was instantiated.
| |
| add | back to summary |
|---|---|
| public final void add(ConstrainedElement constrainedElement) Overrides org. Doc from org. Adds the given element to this builder. It must be checked with
| |
| addToExecutablesByDeclaringType | back to summary |
|---|---|
| private void addToExecutablesByDeclaringType(ConstrainedExecutable executable) Merges the given executable with the metadata contributed by other providers for the same executable in the hierarchy.
| |
| assertCorrectnessOfConfiguration | back to summary |
|---|---|
| private void assertCorrectnessOfConfiguration() Checks the configuration of this method for correctness as per the rules outlined in the Bean Validation specification, section 4.5.5 ("Method constraints in inheritance hierarchies"). In particular, overriding methods in sub-types may not add parameter constraints and the return value of an overriding method may not be marked as cascaded if the return value is marked as cascaded already on the overridden method.
| |
| build | back to summary |
|---|---|
| public ExecutableMetaData build() Implements abstract org. Doc from org. Creates a new, read-only
| |
| findParameterMetaData | back to summary |
|---|---|
| private List Finds the one executable from the underlying hierarchy with parameter constraints. If no executable in the hierarchy is parameter constrained, the parameter meta data from this builder's base executable is returned.
| |
| isConstructor | back to summary |
|---|---|
| private boolean isConstructor(Callable callable) | |
| isResolvedToSameMethodInHierarchy | back to summary |
|---|---|
| private boolean isResolvedToSameMethodInHierarchy(Callable first, Callable other) | |
| overrides | back to summary |
|---|---|
| private boolean overrides(Callable first, Callable other) | |