org.hibernate.validator.method.metadata
Interface TypeDescriptor

All Superinterfaces:
ElementDescriptor
All Known Implementing Classes:
BeanDescriptorImpl

public interface TypeDescriptor
extends ElementDescriptor

Describes a constrained Java type and the constraints associated to it.

Author:
Gunnar Morling

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.validation.metadata.ElementDescriptor
ElementDescriptor.ConstraintFinder
 
Method Summary
 BeanDescriptor getBeanDescriptor()
          Returns a descriptor for the bean related constraints of this type.
 Set<MethodDescriptor> getConstrainedMethods()
          Returns a set with the constrained methods of this type.
 MethodDescriptor getConstraintsForMethod(String methodName, Class<?>... parameterTypes)
          Returns a descriptor for the specified method.
 boolean isTypeConstrained()
          Whether this type has any class-, property- (field or getter style) or method-level constraints or not.
 
Methods inherited from interface javax.validation.metadata.ElementDescriptor
findConstraints, getConstraintDescriptors, getElementClass, hasConstraints
 

Method Detail

isTypeConstrained

boolean isTypeConstrained()
Whether this type has any class-, property- (field or getter style) or method-level constraints or not. This is the case if

Returns:
True, if this type has any constraints, false

getConstrainedMethods

Set<MethodDescriptor> getConstrainedMethods()
Returns a set with the constrained methods of this type.

Returns:
A set with the constrained methods of this type, will be empty if none of this type's methods are constrained.

getConstraintsForMethod

MethodDescriptor getConstraintsForMethod(String methodName,
                                         Class<?>... parameterTypes)
Returns a descriptor for the specified method.

Parameters:
methodName - The name of the method to retrieve a descriptor for.
parameterTypes - The types of the parameters of the method to retrieve a descriptor for, in the order as they are defined in the method signature.
Returns:
A descriptor for the specified method or null, if no method with the given name and parameter types is declared on the type represented by this descriptor or its super types.
Throws:
IllegalArgumentException - if methodName is null.

getBeanDescriptor

BeanDescriptor getBeanDescriptor()
Returns a descriptor for the bean related constraints of this type.

Returns:
A bean descriptor. Will never be null, also if this type has no bean properties.


Copyright © 2007-2011 Red Hat Middleware, LLC. All Rights Reserved