javax.validation.metadata
Interface ExecutableDescriptor

All Superinterfaces:
ElementDescriptor
All Known Subinterfaces:
ConstructorDescriptor, MethodDescriptor

public interface ExecutableDescriptor
extends ElementDescriptor

Provides common functionality of MethodDescriptor and ConstructorDescriptor.

Since:
1.1
Author:
Gunnar Morling

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
ElementDescriptor.ConstraintFinder
 
Method Summary
 boolean areParametersConstrained()
          Returns true if the executable parameters are constrained either: because of a constraint on at least one of the parameters because of a cascade on at least one of the parameters (via @Valid) because of at least one cross-parameter constraint Also returns false if there is no parameter.
 ElementDescriptor.ConstraintFinder findConstraints()
          Returns a finder that will always return an empty Set.
 Set<ConstraintDescriptor<?>> getConstraintDescriptors()
          Returns an empty Set.
 CrossParameterDescriptor getCrossParameterDescriptor()
          Returns a descriptor containing cross-parameter constraints of this executable.
 String getName()
          Returns the method name in case this descriptor represents a method or the non-qualified name of the declaring class in case this descriptor represents a constructor.
 List<ParameterDescriptor> getParameterDescriptors()
          Returns a list with descriptors representing this executable's parameters, in order of their declaration, including synthetic parameters.
 ReturnValueDescriptor getReturnValueDescriptor()
          Returns a descriptor for this executable's return value.
 boolean hasConstraints()
          Returns false.
 boolean isReturnValueConstrained()
          Returns true if the executable return value is constrained either: because of a constraint on the return value because validation is cascaded on the return value (via @Valid) Also returns false if there is no return value.
 
Methods inherited from interface javax.validation.metadata.ElementDescriptor
getElementClass
 

Method Detail

getName

String getName()
Returns the method name in case this descriptor represents a method or the non-qualified name of the declaring class in case this descriptor represents a constructor.

Returns:
The name of the executable represented by this descriptor.

getParameterDescriptors

List<ParameterDescriptor> getParameterDescriptors()
Returns a list with descriptors representing this executable's parameters, in order of their declaration, including synthetic parameters.

Returns:
A list with descriptors representing this executable's parameters. An empty list will be returned if this executable has no parameters, but never null.

getCrossParameterDescriptor

CrossParameterDescriptor getCrossParameterDescriptor()
Returns a descriptor containing cross-parameter constraints of this executable.

Returns:
A descriptor containing cross-parameter constraints of this executable

getReturnValueDescriptor

ReturnValueDescriptor getReturnValueDescriptor()
Returns a descriptor for this executable's return value.

An executable without return value will return a descriptor representing void. This descriptor will have no constraint associated.

Returns:
A descriptor for this executable's return value

areParametersConstrained

boolean areParametersConstrained()
Returns true if the executable parameters are constrained either: Also returns false if there is no parameter.

Returns:
true if the executable parameters are constrained

isReturnValueConstrained

boolean isReturnValueConstrained()
Returns true if the executable return value is constrained either: Also returns false if there is no return value.

Returns:
true if the executable return value is constrained

hasConstraints

boolean hasConstraints()
Returns false.

An executable per se does not host constraints, use getParameterDescriptors(), getCrossParameterDescriptor() and getReturnValueDescriptor() to discover constraints.

Specified by:
hasConstraints in interface ElementDescriptor
Returns:
false

getConstraintDescriptors

Set<ConstraintDescriptor<?>> getConstraintDescriptors()
Returns an empty Set.

An executable per se does not host constraints, use getParameterDescriptors(), getCrossParameterDescriptor() and getReturnValueDescriptor() to discover constraints.

Specified by:
getConstraintDescriptors in interface ElementDescriptor
Returns:
An empty Set

findConstraints

ElementDescriptor.ConstraintFinder findConstraints()
Returns a finder that will always return an empty Set.

An executable per se does not host constraints, use getParameterDescriptors(), getCrossParameterDescriptor() and getReturnValueDescriptor() to discover constraints.

Specified by:
findConstraints in interface ElementDescriptor
Returns:
Constraint finder object.


Copyright © 2007-2013. All Rights Reserved.