public class ConstrainedMethod extends AbstractConstrainedElement
ConstrainedElement.ConstrainedElementKind| Constructor and Description |
|---|
ConstrainedMethod(ConfigurationSource source,
MethodConstraintLocation location,
List<ConstrainedParameter> parameterMetaData,
Set<MetaConstraint<?>> returnValueConstraints,
boolean isCascading)
Creates a new method meta data object.
|
ConstrainedMethod(ConfigurationSource source,
MethodConstraintLocation location,
Set<MetaConstraint<?>> returnValueConstraints,
boolean isCascading)
Creates a new method meta data object for a parameter-less method.
|
| Modifier and Type | Method and Description |
|---|---|
List<ConstrainedParameter> |
getAllParameterMetaData()
Returns meta data for all parameters of the represented method.
|
MethodConstraintLocation |
getLocation()
Returns the location of this constrained element.
|
ConstrainedParameter |
getParameterMetaData(int parameterIndex)
Constraint meta data for the specified parameter.
|
boolean |
hasParameterConstraints()
Whether this method has at least one cascaded parameter or at least one
parameter with constraints.
|
boolean |
isConstrained()
Whether the represented method is constrained or not.
|
boolean |
isGetterMethod()
Whether the represented method is a JavaBeans getter method or not.
|
String |
toString() |
equals, getConstraints, getKind, getSource, hashCode, isCascading, iteratorpublic ConstrainedMethod(ConfigurationSource source, MethodConstraintLocation location, Set<MetaConstraint<?>> returnValueConstraints, boolean isCascading)
source - The source of meta data.location - The location of the represented method.returnValueConstraints - The return value constraints of the represented method, if
any.isCascading - Whether a cascaded validation of the represented method's
return value shall be performed or not.public ConstrainedMethod(ConfigurationSource source, MethodConstraintLocation location, List<ConstrainedParameter> parameterMetaData, Set<MetaConstraint<?>> returnValueConstraints, boolean isCascading)
source - The source of meta data.location - The location of the represented method.parameterMetaData - A list with parameter meta data. The length must correspond
with the number of parameters of the represented method. So
this list may be empty (in case of a parameterless method),
but never null.returnValueConstraints - The return value constraints of the represented method, if
any.isCascading - Whether a cascaded validation of the represented method's
return value shall be performed or not.public MethodConstraintLocation getLocation()
ConstrainedElementgetLocation in interface ConstrainedElementgetLocation in class AbstractConstrainedElementpublic ConstrainedParameter getParameterMetaData(int parameterIndex)
parameterIndex - The index in this method's parameter array of the parameter of
interest.null.IllegalArgumentException - In case this method doesn't have a parameter with the
specified index.public List<ConstrainedParameter> getAllParameterMetaData()
null.public boolean isConstrained()
isConstrained in interface ConstrainedElementisConstrained in class AbstractConstrainedElementTrue, if this method is constrained by any means,
false otherwise.public boolean hasParameterConstraints()
True, if this method has at least one cascading or
constrained parameter, false otherwise.public boolean isGetterMethod()
True, if this method is a getter method,
false otherwise.public String toString()
toString in class AbstractConstrainedElementCopyright © 2007-2012 Red Hat Middleware, LLC. All Rights Reserved