org.hibernate.validator.internal.metadata.aggregated
Class PropertyMetaData

java.lang.Object
  extended by org.hibernate.validator.internal.metadata.aggregated.AbstractConstraintMetaData
      extended by org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData
All Implemented Interfaces:
Iterable<MetaConstraint<?>>, ConstraintMetaData, Cascadable

public class PropertyMetaData
extends AbstractConstraintMetaData
implements Cascadable

Represents the constraint related meta data for a JavaBeans property. Abstracts from the concrete physical type of the underlying Java element(s) (fields or getter methods).

In order to provide a unified access to all JavaBeans constraints also class-level constraints are represented by this meta data type.

Identity is solely based on the property name, hence sets and similar collections of this type may only be created in the scope of one Java type.

Author:
Gunnar Morling

Nested Class Summary
static class PropertyMetaData.Builder
           
 
Method Summary
 PropertyDescriptorImpl asDescriptor(boolean defaultGroupSequenceRedefined, List<Class<?>> defaultGroupSequence)
          Returns this meta data object's corresponding representation in the descriptor model.
 Class<?> convertGroup(Class<?> from)
          Converts the given validation group as per the group conversion configuration for this element (as e.g.
 boolean equals(Object obj)
           
 ElementType getElementType()
           
 Set<GroupConversionDescriptor> getGroupConversionDescriptors()
          Returns a set with GroupConversionDescriptors representing the group conversions of this cascadable.
 Class<?> getRawType()
           
 Object getValue(Object parent)
          Retrieves the value of this element from the given object.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class org.hibernate.validator.internal.metadata.aggregated.AbstractConstraintMetaData
asDescriptors, getConstraints, getKind, getName, getType, isCascading, isConstrained, iterator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hibernate.validator.internal.metadata.facets.Cascadable
getKind, getName
 

Method Detail

getValue

public Object getValue(Object parent)
Description copied from interface: Cascadable
Retrieves the value of this element from the given object.

Specified by:
getValue in interface Cascadable
Parameters:
parent - The object to retrieve the value from.
Returns:
This element's value.

getElementType

public ElementType getElementType()
Specified by:
getElementType in interface Cascadable

getRawType

public Class<?> getRawType()

convertGroup

public Class<?> convertGroup(Class<?> from)
Description copied from interface: Cascadable
Converts the given validation group as per the group conversion configuration for this element (as e.g. specified via @ConvertGroup.

Specified by:
convertGroup in interface Cascadable
Parameters:
from - The group to convert.
Returns:
The converted group. Will be the original group itself in case no conversion is to be performed.

getGroupConversionDescriptors

public Set<GroupConversionDescriptor> getGroupConversionDescriptors()
Description copied from interface: Cascadable
Returns a set with GroupConversionDescriptors representing the group conversions of this cascadable.

Specified by:
getGroupConversionDescriptors in interface Cascadable
Returns:
A set with group conversion descriptors. May be empty, but never null.

asDescriptor

public PropertyDescriptorImpl asDescriptor(boolean defaultGroupSequenceRedefined,
                                           List<Class<?>> defaultGroupSequence)
Description copied from interface: ConstraintMetaData
Returns this meta data object's corresponding representation in the descriptor model.

Specified by:
asDescriptor in interface ConstraintMetaData
Parameters:
defaultGroupSequenceRedefined - Whether the bean hosting the represented element has a redefined default group sequence or not.
defaultGroupSequence - The default group sequence of the bean hosting the represented element.
Returns:
This meta data object's corresponding descriptor model representation. Implementations should return a specific sub type of ElementDescriptor.

toString

public String toString()
Overrides:
toString in class AbstractConstraintMetaData

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractConstraintMetaData

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractConstraintMetaData


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