Hibernate SVN: r15477 - in validator/trunk: hibernate-validator/src/main/java/org/hibernate/validation/impl and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-10-31 15:01:01 -0400 (Fri, 31 Oct 2008)
New Revision: 15477
Added:
validator/trunk/validation-api/src/main/java/javax/validation/BeanDescriptor.java
validator/trunk/validation-api/src/main/java/javax/validation/PropertyDescriptor.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProvider.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProviderImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ElementDescriptorImpl.java
validator/trunk/validation-api/src/main/java/javax/validation/ElementDescriptor.java
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
Log:
BVAL-46 split Elementdescriptor into BeanDescriptor and PropertyDescriptor
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProvider.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProvider.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProvider.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -23,6 +23,8 @@
import java.util.List;
import java.util.Map;
import javax.validation.ElementDescriptor;
+import javax.validation.BeanDescriptor;
+import javax.validation.PropertyDescriptor;
/**
* Interface defining the meta data about the constraints defined in a given bean.
@@ -39,7 +41,7 @@
/**
* @return an instance of <code>ElementDescriptor</code> describing the bean this meta data applies for.
*/
- ElementDescriptor getBeanDescriptor();
+ BeanDescriptor getBeanDescriptor();
/**
* @return A list of all cascaded fields (fields annotated with @Valid).
@@ -73,7 +75,7 @@
* @todo Maybe needs to be removed since this data structure is ambigious. There could be conflicts between field and
* methods.
*/
- Map<String, ElementDescriptor> getPropertyDescriptors();
+ Map<String, PropertyDescriptor> getPropertyDescriptors();
ElementDescriptor getPropertyDescriptors(String property);
}
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProviderImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProviderImpl.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/MetaDataProviderImpl.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -26,12 +26,13 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.validation.BeanDescriptor;
import javax.validation.Constraint;
import javax.validation.ConstraintFactory;
import javax.validation.ConstraintValidator;
-import javax.validation.ElementDescriptor;
import javax.validation.GroupSequence;
import javax.validation.GroupSequences;
+import javax.validation.PropertyDescriptor;
import javax.validation.Valid;
import javax.validation.ValidationException;
@@ -84,7 +85,7 @@
* Maps field and method names to their <code>ElementDescriptorImpl</code>.
* FIXME This model is problematic as you can have conflicting names for fields and methods
*/
- private Map<String, ElementDescriptor> propertyDescriptors = new HashMap<String, ElementDescriptor>();
+ private Map<String, PropertyDescriptor> propertyDescriptors = new HashMap<String, PropertyDescriptor>();
/**
* Factory to create acutal constraint instances from the annotated fields/method/class.
@@ -392,7 +393,7 @@
return beanClass;
}
- public ElementDescriptor getBeanDescriptor() {
+ public BeanDescriptor getBeanDescriptor() {
return beanDescriptor;
}
@@ -419,11 +420,11 @@
return metaConstraintList;
}
- public Map<String, ElementDescriptor> getPropertyDescriptors() {
+ public Map<String, PropertyDescriptor> getPropertyDescriptors() {
return propertyDescriptors;
}
- public ElementDescriptor getPropertyDescriptors(String property) {
+ public PropertyDescriptor getPropertyDescriptors(String property) {
return propertyDescriptors.get( property );
}
}
\ No newline at end of file
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ValidatorImpl.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -34,6 +34,8 @@
import javax.validation.ConstraintViolation;
import javax.validation.MessageResolver;
import javax.validation.Validator;
+import javax.validation.PropertyDescriptor;
+import javax.validation.BeanDescriptor;
import org.hibernate.validation.Version;
import org.hibernate.validation.ValidatorConstants;
@@ -505,18 +507,17 @@
return metaDataProvider.getConstraintMetaDataList().size() > 0;
}
- public ElementDescriptor getConstraintsForBean() {
+ public BeanDescriptor getConstraintsForBean() {
return metaDataProvider.getBeanDescriptor();
}
- public ElementDescriptor getConstraintsForProperty(String propertyName) {
+ public PropertyDescriptor getConstraintsForProperty(String propertyName) {
return metaDataProvider.getPropertyDescriptors().get( propertyName );
}
- public String[] getValidatedProperties() {
- return metaDataProvider.getPropertyDescriptors()
- .keySet()
- .toArray( new String[metaDataProvider.getPropertyDescriptors().size()] );
+ public Set<String> getValidatedProperties() {
+ return Collections.unmodifiableSet( metaDataProvider.getPropertyDescriptors()
+ .keySet() );
}
public MetaDataProvider<T> getMetaDataProvider() {
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ElementDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ElementDescriptorImpl.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ElementDescriptorImpl.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -23,6 +23,8 @@
import java.util.List;
import javax.validation.ConstraintDescriptor;
import javax.validation.ElementDescriptor;
+import javax.validation.BeanDescriptor;
+import javax.validation.PropertyDescriptor;
/**
* Describe a validated element (class, field or property).
@@ -32,7 +34,8 @@
* @todo Should returnType be renamed to type?
* @todo Handle problem in descirbing cyclic dependecies for propertyPath
*/
-public class ElementDescriptorImpl implements ElementDescriptor {
+//FIXME I implement both interfaces on the same object as a quick hack, we need to fix that.
+public class ElementDescriptorImpl implements PropertyDescriptor, BeanDescriptor {
private final Class returnType;
private final boolean cascaded;
private final List<ConstraintDescriptor> constraintDescriptors = new ArrayList<ConstraintDescriptor>();
@@ -75,7 +78,7 @@
/**
* {@inheritDoc}
*/
- public String getPropertyPath() {
+ public String getPropertyName() {
return propertyPath;
}
}
Added: validator/trunk/validation-api/src/main/java/javax/validation/BeanDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/BeanDescriptor.java (rev 0)
+++ validator/trunk/validation-api/src/main/java/javax/validation/BeanDescriptor.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -0,0 +1,9 @@
+package javax.validation;
+
+/**
+ * Describe a constrained Java Bean and the constraints associated to it.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface BeanDescriptor extends ElementDescriptor {
+}
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ElementDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ElementDescriptor.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ElementDescriptor.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -33,23 +33,11 @@
*
* @todo should it be Type or even completly removed
*/
- Class getType();
+ Class<?> getType();
/**
- * @return Returns <code>true</code> if the association is cascaded, <code>false</code> otherwise.
- */
- boolean isCascaded();
-
- /**
* @return All the constraint descriptors for this element.
*/
List<ConstraintDescriptor> getConstraintDescriptors();
- /**
- * @return Property path from the root entity validated.
- *
- * @todo there is a problem in describing cyclic dependencies
- */
- String getPropertyPath();
-
}
Added: validator/trunk/validation-api/src/main/java/javax/validation/PropertyDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/PropertyDescriptor.java (rev 0)
+++ validator/trunk/validation-api/src/main/java/javax/validation/PropertyDescriptor.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -0,0 +1,23 @@
+package javax.validation;
+
+/**
+ * Describes a Java Bean property hosting validation constraints.
+ *
+ * Constraints placed on the attribute and the getter for a given property
+ * are all referenced by this object.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface PropertyDescriptor extends ElementDescriptor {
+ /**
+ * Is the property marked by the <code>@Valid</code> annotation.
+ * @return true if the annotation is present
+ */
+ boolean isCascaded();
+
+ /**
+ * Name of the property acording to the Java Bean specification.
+ * @return property name
+ */
+ String getPropertyName();
+}
\ No newline at end of file
Modified: validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-10-31 18:13:28 UTC (rev 15476)
+++ validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-10-31 19:01:01 UTC (rev 15477)
@@ -76,17 +76,17 @@
/**
* return the class level constraints
*/
- ElementDescriptor getConstraintsForBean();
+ BeanDescriptor getConstraintsForBean();
/**
* return the property level constraints for a given propertyName
* or null if either the property does not exist or has no constraint
*/
- ElementDescriptor getConstraintsForProperty(String propertyName);
+ PropertyDescriptor getConstraintsForProperty(String propertyName);
/**
* return the property names having at least a constraint defined
*/
- String[] getValidatedProperties();
+ Set<String> getValidatedProperties();
}
16 years, 1 month
Hibernate SVN: r15476 - in validator/trunk: validation-api/src/main/java/javax/validation and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-10-31 14:13:28 -0400 (Fri, 31 Oct 2008)
New Revision: 15476
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
Log:
BVAL-45 typo on constraint descriptor
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java 2008-10-31 18:06:19 UTC (rev 15475)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java 2008-10-31 18:13:28 UTC (rev 15476)
@@ -78,7 +78,7 @@
/**
* {@inheritDoc}
*/
- public Class<? extends Constraint> getContstraintClass() {
+ public Class<? extends Constraint> getConstraintClass() {
return constraintClass;
}
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2008-10-31 18:06:19 UTC (rev 15475)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2008-10-31 18:13:28 UTC (rev 15476)
@@ -45,7 +45,7 @@
/**
* @return the constraint implementation class
*/
- Class<? extends Constraint> getContstraintClass();
+ Class<? extends Constraint> getConstraintClass();
/**
* Returns a map containing the annotation parameter names as keys and the annotation parameter values
16 years, 1 month
Hibernate SVN: r15475 - in validator/trunk: validation-api/src/main/java/javax/validation and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2008-10-31 14:06:19 -0400 (Fri, 31 Oct 2008)
New Revision: 15475
Added:
validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java
Removed:
validator/trunk/validation-api/src/main/java/javax/validation/InvalidConstraint.java
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
validator/trunk/validation-api/src/main/java/javax/validation/Context.java
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
Log:
BVAL-40 rename ConstraintViolation
Modified: validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java
===================================================================
--- validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintDescriptorImpl.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -28,7 +28,7 @@
import java.util.Set;
import javax.validation.Constraint;
import javax.validation.ConstraintDescriptor;
-import javax.validation.ReportAsSingleInvalidConstraint;
+import javax.validation.ReportAsViolationFromComposingConstraint;
import javax.validation.ValidationException;
/**
@@ -55,7 +55,7 @@
this.constraintImplementation = validator;
this.parameters = getAnnotationParameters( annotation );
this.isReportAsSingleInvalidConstraint = annotation.annotationType().isAnnotationPresent(
- ReportAsSingleInvalidConstraint.class
+ ReportAsViolationFromComposingConstraint.class
);
this.constraintClass = constraintClass;
}
@@ -114,7 +114,7 @@
/**
* {@inheritDoc}
*/
- public boolean isReportAsSingleInvalidConstraint() {
+ public boolean ReportAsViolationFromComposingConstraint() {
return isReportAsSingleInvalidConstraint;
}
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintDescriptor.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -70,5 +70,5 @@
/**
* @return true if the constraint is annotated with @ReportAsSingleInvalidConstraint
*/
- boolean isReportAsSingleInvalidConstraint();
+ boolean ReportAsViolationFromComposingConstraint();
}
Modified: validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -20,7 +20,8 @@
import java.util.Set;
/**
- * Describe a constraint validation defect.
+ * Describe a constraint violation. This object describe the error context as
+ * well as the message describing the violation.
*
* @author Emmanuel Bernard
* @todo add pointers to the metadata?
Modified: validator/trunk/validation-api/src/main/java/javax/validation/Context.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/Context.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/validation-api/src/main/java/javax/validation/Context.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -7,8 +7,8 @@
*/
public interface Context {
/**
- * Disable default error message and default InvalidConstraint object generation.
- * Useful to set a different error message or generate an InvalidConstraint based on
+ * Disable default error message and default ConstraintViolation object generation.
+ * Useful to set a different error message or generate an ConstraintViolation based on
* a different property
*
* @see #addError(String)
@@ -25,13 +25,13 @@
/**
* Add a new unexpanded error message.
* <p/>
- * If isValid returns false, an InvalidConstraint object will be built per error message
+ * If isValid returns false, a ConstraintViolation object will be built per error message
* including the default one unless #disableDefaultErrorMEssage() has been called.
* <p/>
- * Aside from the error message, InvalidConstraint objects generated from such a call
+ * Aside from the error message, ConstraintViolation objects generated from such a call
* contains the same contextual information (root bean, path and so on)
* <p/>
- * This method can be called multiple time. One InvalidConstraint instance per call is created.
+ * This method can be called multiple time. One ConstraintViolation instance per call is created.
*
* @param message new unexpanded error message
*/
@@ -40,13 +40,13 @@
/**
* Add a new unexpanded error message to a given sub property.
* <p/>
- * If isValid returns false, an InvalidConstraint object will be built per error message including the default one
+ * If isValid returns false, a ConstraintViolation object will be built per error message including the default one
* if null apply to the current property or the bean the constraint is applied on, otherwise apply to the <code>property</code> named
* <p/>
* TODO exception or swallowed when bean-level instance is not present?
*
* @param message new unexpanded error message
- * @param property property name the InvalidConstraint is targeting
+ * @param property property name the ConstraintViolation is targeting
*
* @throws ValidationException when the property is not present on the bean level object
*/
Deleted: validator/trunk/validation-api/src/main/java/javax/validation/InvalidConstraint.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/InvalidConstraint.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/validation-api/src/main/java/javax/validation/InvalidConstraint.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -1,73 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package javax.validation;
-
-import java.util.Set;
-
-/**
- * Describe a constraint validation defect.
- *
- * @author Emmanuel Bernard
- * @todo add pointers to the metadata?
- * @todo the rational behind rootBean and propertyPath is to keep the context available to the user
- */
-public interface InvalidConstraint<T> {
-
- /**
- * @return The error message for this constraint violation.
- */
- String getMessage();
-
- /**
- * @return The root bean being validated.
- */
- T getRootBean();
-
- /**
- * If a bean constraint, the bean instance the constraint is applied on
- * If a property constraint, the bean instance hosting the property the constraint is applied on
- *
- * @return the leaf bean the constraint is applied on or null if Validator#validateValue is used
- */
- Object getLeafBean();
-
- /**
- * @return the property path to the value from <code>rootBean</code>
- * <code>null</code> if the value is the <code>rootBean<code> itself.
- */
- String getPropertyPath();
-
-
- /**
- * @return the bean type being validated.
- */
- Class<T> getBeanClass();
-
- /**
- * @return the value failing to pass the constraint.
- */
- Object getValue();
-
- /**
- * @return the list of groups that the triggered constraint applies on and which also are
- * within the list of groups requested for validation.
- *
- * TODO: considering removal, if you think it's important, speak up
- */
- Set<String> getGroups();
-}
Copied: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java (from rev 15465, validator/trunk/validation-api/src/main/java/javax/validation/ReportAsSingleInvalidConstraint.java)
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java (rev 0)
+++ validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -0,0 +1,35 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.validation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+
+/**
+ * A constraint annotation annotated with this annotation
+ * will return the composed annotation error report if any of the composing annotations
+ * fail. The error reports of each individual composing constraint is ignored.
+ *
+ * @author Emmanuel Bernard
+ */
+@Target({ ANNOTATION_TYPE })
+@Retention(RUNTIME)
+public @interface ReportAsViolationFromComposingConstraint {
+}
Property changes on: validator/trunk/validation-api/src/main/java/javax/validation/ReportAsViolationFromComposingConstraint.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
===================================================================
--- validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-10-31 17:29:01 UTC (rev 15474)
+++ validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-10-31 18:06:19 UTC (rev 15475)
@@ -29,44 +29,41 @@
*/
public interface Validator<T> extends Serializable {
/**
- * validate all constraints on object (unless shortcut)
+ * validate all constraints on object
*
* @param object object to validate
- * @param groups group name(s) targeted for validation (default to <code>default</code>
+ * @param groups group name(s) targeted for validation (default to <code>default</code>)
*
- * @return array of invalid constrains or an empty array if none.
+ * @return constraint violations or an empty Set if none
*
- * @throws IllegalArgumentException e if object is <code>null</code>.
+ * @throws IllegalArgumentException e if object is null
*/
Set<ConstraintViolation<T>> validate(T object, String... groups);
/**
- * validate all constraints on propertyname property of object (unless shortcut)
- * <p/>
+ * validate all constraints on <code>propertyName</code> property of object
*
* @param object object to validate
* @param propertyName property to validate
- * @param groups group name(s) targeted for validation (default to <code>default</code>
+ * @param groups group name(s) targeted for validation (default to <code>default</code>)
*
- * @return array of invalid constrains or an empty array if none
+ * @return constraint violations or an empty Set if none
*
- * @throws IllegalArgumentException e if object is <code>null</code>.
- * @todo Do we keep this method?
+ * @throws IllegalArgumentException e if object is null
*/
Set<ConstraintViolation<T>> validateProperty(T object, String propertyName, String... groups);
/**
- * Validates all constraints on propertyname property if the property value is value (unless shortcut)
+ * validate all constraints on <code>propertyName</code> property
+ * if the property value is <code>value</code>
* <p/>
+ * TODO express limitations of ConstraintViolation in this case
*
* @param propertyName property to validate
* @param value property value to validate
- * @param groups group name(s) targeted for validation (default to <code>default</code>
+ * @param groups group name(s) targeted for validation (default to <code>default</code>)
*
- * @return array of invalid constrains or an empty array if none
- *
- * @todo Do we keep this method?
- * @todo express limitations of InvalidConstraint in this case.
+ * @return constraint violations or an empty Set if none
*/
Set<ConstraintViolation<T>> validateValue(String propertyName, Object value, String... groups);
@@ -85,7 +82,7 @@
* return the property level constraints for a given propertyName
* or null if either the property does not exist or has no constraint
*/
- ElementDescriptor getConstraintsForProperty(String propertyName);
+ ElementDescriptor getConstraintsForProperty(String propertyName);
/**
* return the property names having at least a constraint defined
16 years, 1 month
Hibernate SVN: r15474 - in core/trunk/entitymanager/src: test and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:29:01 -0400 (Fri, 31 Oct 2008)
New Revision: 15474
Added:
core/trunk/entitymanager/src/test/resources/
Removed:
core/trunk/entitymanager/src/test-resources/
Log:
HHH-3580 : import entitymanager into core
Copied: core/trunk/entitymanager/src/test/resources (from rev 15473, core/trunk/entitymanager/src/test-resources)
16 years, 1 month
Hibernate SVN: r15473 - in core/trunk/entitymanager/src/test: java and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:27:49 -0400 (Fri, 31 Oct 2008)
New Revision: 15473
Added:
core/trunk/entitymanager/src/test/java/NoPackageEntity.java
Removed:
core/trunk/entitymanager/src/test/NoPackageEntity.java
Log:
HHH-3580 : import entitymanager into core
Deleted: core/trunk/entitymanager/src/test/NoPackageEntity.java
===================================================================
--- core/trunk/entitymanager/src/test/NoPackageEntity.java 2008-10-31 17:22:32 UTC (rev 15472)
+++ core/trunk/entitymanager/src/test/NoPackageEntity.java 2008-10-31 17:27:49 UTC (rev 15473)
@@ -1,9 +0,0 @@
-//$Id: $
-
-/**
- * @author Emmanuel Bernard
- */
-public class NoPackageEntity {
- private Integer id;
- private String name;
-}
Copied: core/trunk/entitymanager/src/test/java/NoPackageEntity.java (from rev 15472, core/trunk/entitymanager/src/test/NoPackageEntity.java)
===================================================================
--- core/trunk/entitymanager/src/test/java/NoPackageEntity.java (rev 0)
+++ core/trunk/entitymanager/src/test/java/NoPackageEntity.java 2008-10-31 17:27:49 UTC (rev 15473)
@@ -0,0 +1,9 @@
+//$Id: $
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class NoPackageEntity {
+ private Integer id;
+ private String name;
+}
16 years, 1 month
Hibernate SVN: r15472 - in core/trunk/entitymanager/src/test: java and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:22:32 -0400 (Fri, 31 Oct 2008)
New Revision: 15472
Added:
core/trunk/entitymanager/src/test/java/org/
Removed:
core/trunk/entitymanager/src/test/org/
Log:
HHH-3580 : import entitymanager into core
Copied: core/trunk/entitymanager/src/test/java/org (from rev 15471, core/trunk/entitymanager/src/test/org)
16 years, 1 month
Hibernate SVN: r15471 - core/trunk/entitymanager/src/test.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:21:32 -0400 (Fri, 31 Oct 2008)
New Revision: 15471
Added:
core/trunk/entitymanager/src/test/java/
Log:
HHH-3580 : import entitymanager into core
16 years, 1 month
Hibernate SVN: r15470 - in core/trunk/entitymanager/src: main and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:18:48 -0400 (Fri, 31 Oct 2008)
New Revision: 15470
Added:
core/trunk/entitymanager/src/main/resources/
Removed:
core/trunk/entitymanager/src/resources/
Log:
HHH-3580 : import entitymanager into core
Copied: core/trunk/entitymanager/src/main/resources (from rev 15469, core/trunk/entitymanager/src/resources)
16 years, 1 month
Hibernate SVN: r15469 - in core/trunk/entitymanager/src: main and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:15:43 -0400 (Fri, 31 Oct 2008)
New Revision: 15469
Added:
core/trunk/entitymanager/src/main/java/
Removed:
core/trunk/entitymanager/src/java/
Log:
HHH-3580 : import entitymanager into core
Copied: core/trunk/entitymanager/src/main/java (from rev 15468, core/trunk/entitymanager/src/java)
16 years, 1 month
Hibernate SVN: r15468 - core/trunk/entitymanager/src.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2008-10-31 13:15:06 -0400 (Fri, 31 Oct 2008)
New Revision: 15468
Added:
core/trunk/entitymanager/src/main/
Log:
HHH-3580 : import entitymanager into core
16 years, 1 month