net.sf.oval.configuration.annotation
Class JPAAnnotationsConfigurer
java.lang.Object
net.sf.oval.configuration.annotation.JPAAnnotationsConfigurer
- All Implemented Interfaces:
- Configurer
public class JPAAnnotationsConfigurer
- extends Object
- implements Configurer
Constraints configurer that interprets certain EJB3 JPA annotations:
- javax.persistence.Basic(optional=false) => net.sf.oval.constraint.NotNullCheck
- javax.persistence.OneToOne(optional=false) => net.sf.oval.constraint.NotNullCheck, net.sf.oval.constraint.AssertValidCheck
- javax.persistence.ManyToOne(optional=false) => net.sf.oval.constraint.NotNullCheck, net.sf.oval.constraint.AssertValidCheck
- javax.persistence.ManyToMany => net.sf.oval.constraint.AssertValidCheck
- javax.persistence.Column(nullable=false) => net.sf.oval.constraint.NotNullCheck
- javax.persistence.Column(length=5) => net.sf.oval.constraint.LengthCheck
- Author:
- Sebastian Thomschke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
applyFieldConstraintsToSetters
protected Boolean applyFieldConstraintsToSetters
applyFieldConstraintsToConstructors
protected Boolean applyFieldConstraintsToConstructors
JPAAnnotationsConfigurer
public JPAAnnotationsConfigurer()
getApplyFieldConstraintsToConstructors
public Boolean getApplyFieldConstraintsToConstructors()
- Returns:
- the applyFieldConstraintsToConstructors
getClassConfiguration
public ClassConfiguration getClassConfiguration(Class<?> clazz)
- Returns the constraint configurations for the given class. This method
is invoked only once by the Validator, the very first time an object
of the given class needs to be validated. The constraint configuration
is then translated into an Validator internal format and cached.
- Specified by:
getClassConfiguration
in interface Configurer
- Parameters:
clazz
- the class to get the configuration for
- Returns:
- The constraint configurations for the given class.
getConstraintSetConfiguration
public ConstraintSetConfiguration getConstraintSetConfiguration(String constraintSetId)
- Returns the constraint configuration for the constraint set with the
given Id.
- Specified by:
getConstraintSetConfiguration
in interface Configurer
- Parameters:
constraintSetId
- the ID of the constraint set
- Returns:
- The constraint configuration for the constraint set with the given Id.
initializeChecks
protected void initializeChecks(javax.persistence.Basic annotation,
Collection<Check> checks)
initializeChecks
protected void initializeChecks(javax.persistence.Column annotation,
Collection<Check> checks,
AccessibleObject fieldOrMethod)
initializeChecks
protected void initializeChecks(javax.persistence.ManyToMany annotation,
Collection<Check> checks)
initializeChecks
protected void initializeChecks(javax.persistence.ManyToOne annotation,
Collection<Check> checks)
initializeChecks
protected void initializeChecks(javax.persistence.OneToMany annotation,
Collection<Check> checks)
initializeChecks
protected void initializeChecks(javax.persistence.OneToOne annotation,
Collection<Check> checks)
isApplyFieldConstraintsToSetter
public Boolean isApplyFieldConstraintsToSetter()
- Returns:
- the applyFieldConstraintsToSetter
setApplyFieldConstraintsToConstructors
public void setApplyFieldConstraintsToConstructors(Boolean applyFieldConstraintsToConstructors)
- Parameters:
applyFieldConstraintsToConstructors
- the applyFieldConstraintsToConstructors to set
setApplyFieldConstraintsToSetters
public void setApplyFieldConstraintsToSetters(Boolean applyFieldConstraintsToSetters)
- Parameters:
applyFieldConstraintsToSetters
- the applyFieldConstraintsToSetter to set
Copyright © 2005-2013 The OVal Development Team. All Rights Reserved.