public class ConstrainedExecutable extends AbstractConstrainedElement
ConstrainedElement.ConstrainedElementKind
constraints, groupConversions, isCascading, location, source, unwrapMode
Constructor and Description |
---|
ConstrainedExecutable(ConfigurationSource source,
ConstraintLocation location,
List<ConstrainedParameter> parameterMetaData,
Set<MetaConstraint<?>> crossParameterConstraints,
Set<MetaConstraint<?>> returnValueConstraints,
Set<MetaConstraint<?>> typeArgumentsConstraints,
Map<Class<?>,Class<?>> groupConversions,
boolean isCascading,
UnwrapMode unwrapMode)
Creates a new executable meta data object.
|
ConstrainedExecutable(ConfigurationSource source,
ConstraintLocation location,
Set<MetaConstraint<?>> returnValueConstraints,
Map<Class<?>,Class<?>> groupConversions,
boolean isCascading,
UnwrapMode unwrapMode)
Creates a new executable meta data object for a parameter-less executable.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<ConstrainedParameter> |
getAllParameterMetaData()
Returns meta data for all parameters of the represented executable.
|
Set<MetaConstraint<?>> |
getCrossParameterConstraints() |
ExecutableElement |
getExecutable() |
ConstrainedParameter |
getParameterMetaData(int parameterIndex)
Constraint meta data for the specified parameter.
|
Set<MetaConstraint<?>> |
getTypeArgumentsConstraints() |
int |
hashCode() |
boolean |
hasParameterConstraints()
Whether this executable has at least one cascaded parameter or at least one
parameter with constraints or at least one cross-parameter constraint.
|
boolean |
isConstrained()
Whether the represented executable is constrained or not.
|
boolean |
isEquallyParameterConstrained(ConstrainedExecutable other)
Whether this and the given other executable have the same parameter
constraints.
|
boolean |
isGetterMethod()
Whether the represented executable is a JavaBeans getter executable or not.
|
ConstrainedExecutable |
merge(ConstrainedExecutable other)
Creates a new constrained executable object by merging this and the given
other executable.
|
String |
toString() |
getConstraints, getGroupConversions, getKind, getLocation, isCascading, iterator, unwrapMode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ConstrainedExecutable(ConfigurationSource source, ConstraintLocation location, Set<MetaConstraint<?>> returnValueConstraints, Map<Class<?>,Class<?>> groupConversions, boolean isCascading, UnwrapMode unwrapMode)
source
- The source of meta data.location
- The location of the represented executable.returnValueConstraints
- Type arguments constraints, if any.groupConversions
- The group conversions of the represented executable, if any.isCascading
- Whether a cascaded validation of the represented executable's
return value shall be performed or not.unwrapMode
- Whether the value of the executable's return value must be unwrapped prior to
validation or not.public ConstrainedExecutable(ConfigurationSource source, ConstraintLocation location, List<ConstrainedParameter> parameterMetaData, Set<MetaConstraint<?>> crossParameterConstraints, Set<MetaConstraint<?>> returnValueConstraints, Set<MetaConstraint<?>> typeArgumentsConstraints, Map<Class<?>,Class<?>> groupConversions, boolean isCascading, UnwrapMode unwrapMode)
source
- The source of meta data.location
- The location of the represented executable.parameterMetaData
- A list with parameter meta data. The length must correspond with the number of
parameters of the represented executable. So this list may be empty (in case of a parameterless executable), but
never null
.crossParameterConstraints
- the cross parameter constraintsreturnValueConstraints
- The return value constraints of the represented executable, if any.typeArgumentsConstraints
- The type argument constraints on the return value of the represented executable,
if any.groupConversions
- The group conversions of the represented executable, if any.isCascading
- Whether a cascaded validation of the represented executable's return value shall be performed
or not.unwrapMode
- Determines how the value of the executable's return value must be handled in regards to
unwrapping prior to validation.public ConstrainedParameter getParameterMetaData(int parameterIndex)
parameterIndex
- The index in this executable's parameter array of the parameter of
interest.null
.IllegalArgumentException
- In case this executable doesn't have a parameter with the
specified index.public List<ConstrainedParameter> getAllParameterMetaData()
null
.public Set<MetaConstraint<?>> getCrossParameterConstraints()
public boolean isConstrained()
isConstrained
in interface ConstrainedElement
isConstrained
in class AbstractConstrainedElement
True
if this executable is constrained by any means,
false
otherwise.public boolean hasParameterConstraints()
True
, if this executable is parameter-constrained by any
means, false
otherwise.public boolean isGetterMethod()
True
, if this executable is a getter method, false
otherwise.public ExecutableElement getExecutable()
public Set<MetaConstraint<?>> getTypeArgumentsConstraints()
public String toString()
toString
in class AbstractConstrainedElement
public boolean isEquallyParameterConstrained(ConstrainedExecutable other)
other
- The other executable to check.public ConstrainedExecutable merge(ConstrainedExecutable other)
other
- The executable to merge.public int hashCode()
hashCode
in class AbstractConstrainedElement
public boolean equals(Object obj)
equals
in class AbstractConstrainedElement
Copyright © 2017 JBoss by Red Hat. All rights reserved.