Top Description Methods
javax.validation.metadata

public Interface ExecutableDescriptor

extends ElementDescriptor
Known Direct Subinterfaces
javax.validation.metadata.MethodDescriptor, javax.validation.metadata.ConstructorDescriptor
Imports
javax.validation.Valid, java.util.List, .Set

Provides the common functionality of MethodDescriptor and ConstructorDescriptor.
Author
Gunnar Morling
Since
1.1

Method Summary

Modifier and TypeMethod and Description
public ElementDescriptor.ConstraintFinder

Returns:

ConstraintFinder object
findConstraints
()

Redeclares javax.validation.metadata.ElementDescriptor.findConstraints.

Returns a finder that will always return an empty Set.
public Set<ConstraintDescriptor<?>>
public CrossParameterDescriptor

Returns:

a descriptor containing the cross-parameter constraints of this executable
getCrossParameterDescriptor
()

Returns a descriptor containing the cross-parameter constraints of this executable.

public String

Returns:

the name of the executable represented by this descriptor
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.

public List<ParameterDescriptor>

Returns:

a list of descriptors representing this executable's parameters; an empty list will be returned if this executable has no parameters, but never null
getParameterDescriptors
()

Returns a list of descriptors representing this executable's parameters, in the order of their declaration, including synthetic parameters.

public ReturnValueDescriptor

Returns:

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

Returns a descriptor for this executable's return value.

public boolean

Returns:

true if the executable parameters are constrained
hasConstrainedParameters
()

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
public boolean

Returns:

true if the executable return value is constrained
hasConstrainedReturnValue
()

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)
public boolean
Inherited from javax.validation.metadata.ElementDescriptor:
getElementClass

Method Detail

findConstraintsback to summary
public ElementDescriptor.ConstraintFinder findConstraints()

Redeclares javax.validation.metadata.ElementDescriptor.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.

Returns:ElementDescriptor.ConstraintFinder

ConstraintFinder object

Annotations
@Override
getConstraintDescriptorsback to summary
public Set<ConstraintDescriptor<?>> getConstraintDescriptors()

Redeclares javax.validation.metadata.ElementDescriptor.getConstraintDescriptors.

Returns an empty Set.

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

Returns:Set<ConstraintDescriptor<?>>

an empty Set

Annotations
@Override
getCrossParameterDescriptorback to summary
public CrossParameterDescriptor getCrossParameterDescriptor()

Returns a descriptor containing the cross-parameter constraints of this executable.

Returns:CrossParameterDescriptor

a descriptor containing the cross-parameter constraints of this executable

getNameback to summary
public 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:String

the name of the executable represented by this descriptor

getParameterDescriptorsback to summary
public List<ParameterDescriptor> getParameterDescriptors()

Returns a list of descriptors representing this executable's parameters, in the order of their declaration, including synthetic parameters.

Returns:List<ParameterDescriptor>

a list of descriptors representing this executable's parameters; an empty list will be returned if this executable has no parameters, but never null

getReturnValueDescriptorback to summary
public 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:ReturnValueDescriptor

a descriptor for this executable's return value

hasConstrainedParametersback to summary
public boolean hasConstrainedParameters()

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.

Returns:boolean

true if the executable parameters are constrained

hasConstrainedReturnValueback to summary
public boolean hasConstrainedReturnValue()

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.

Returns:boolean

true if the executable return value is constrained

hasConstraintsback to summary
public boolean hasConstraints()

Redeclares javax.validation.metadata.ElementDescriptor.hasConstraints.

Returns false.

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

Returns:boolean

false

Annotations
@Override