Author: epbernard
Date: 2008-11-03 18:49:23 -0500 (Mon, 03 Nov 2008)
New Revision: 15490
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintViolationImpl.java
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
Log:
BVAL-61 rename getValue to getInvalidValue
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintViolationImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintViolationImpl.java 2008-11-03
22:32:21 UTC (rev 15489)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/impl/ConstraintViolationImpl.java 2008-11-03
23:49:23 UTC (rev 15490)
@@ -74,7 +74,7 @@
/**
* {@inheritDoc}
*/
- public Object getValue() {
+ public Object getInvalidValue() {
return value;
}
Modified:
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java
===================================================================
---
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2008-11-03
22:32:21 UTC (rev 15489)
+++
validator/trunk/hibernate-validator/src/test/java/org/hibernate/validation/engine/ValidatorImplTest.java 2008-11-03
23:49:23 UTC (rev 15490)
@@ -120,7 +120,7 @@
assertEquals( "Wrong message", "may not be empty",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Book.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", book, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", book.getTitle(), constraintViolation.getValue()
);
+ assertEquals( "Wrong value", book.getTitle(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "title",
constraintViolation.getPropertyPath() );
book.setTitle( "Hibernate Persistence with JPA" );
@@ -132,7 +132,7 @@
assertEquals( "Wrong message", "length must be between 0 and 30",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Book.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", book, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", book.getSubtitle(),
constraintViolation.getValue() );
+ assertEquals( "Wrong value", book.getSubtitle(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "subtitle",
constraintViolation.getPropertyPath() );
book.setSubtitle( "Revised Edition" );
@@ -144,7 +144,7 @@
assertEquals( "Wrong message", "length must be between 0 and 20",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Author.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", book, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", author.getCompany(),
constraintViolation.getValue() );
+ assertEquals( "Wrong value", author.getCompany(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "author.company",
constraintViolation.getPropertyPath() );
author.setCompany( "JBoss" );
@@ -175,7 +175,7 @@
assertEquals( "Wrong message", "may not be null",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Book.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", book, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", book.getTitle(), constraintViolation.getValue()
);
+ assertEquals( "Wrong value", book.getTitle(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "title",
constraintViolation.getPropertyPath() );
book.setTitle( "Hibernate Persistence with JPA" );
@@ -316,7 +316,7 @@
assertEquals( "Wrong message", "may not be null",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Order.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", customer,
constraintViolation.getRootBean() );
- assertEquals( "Wrong value", order1.getOrderNumber(),
constraintViolation.getValue() );
+ assertEquals( "Wrong value", order1.getOrderNumber(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "orderList[0].orderNumber",
constraintViolation.getPropertyPath() );
}
@@ -366,7 +366,7 @@
assertEquals( "Wrong message", "may not be empty",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", Actor.class,
constraintViolation.getBeanClass() );
assertEquals( "Wrong root entity", clint, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", morgan.getLastName(),
constraintViolation.getValue() );
+ assertEquals( "Wrong value", morgan.getLastName(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName",
"playedWith[0].playedWith[1].lastName", constraintViolation.getPropertyPath()
);
}
@@ -386,7 +386,7 @@
assertEquals( "Wrong message", "may not be null",
constraintViolation.getMessage() );
assertEquals( "Wrong bean class", null, constraintViolation.getBeanClass()
);
assertEquals( "Wrong root entity", null, constraintViolation.getRootBean()
);
- assertEquals( "Wrong value", order.getOrderNumber(),
constraintViolation.getValue() );
+ assertEquals( "Wrong value", order.getOrderNumber(),
constraintViolation.getInvalidValue() );
assertEquals( "Wrong propertyName", "orderList[0].orderNumber",
constraintViolation.getPropertyPath() );
constraintViolations = validator.validateValue( "orderList[0].orderNumber",
"1234" );
Modified:
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java
===================================================================
---
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-11-03
22:32:21 UTC (rev 15489)
+++
validator/trunk/validation-api/src/main/java/javax/validation/ConstraintViolation.java 2008-11-03
23:49:23 UTC (rev 15490)
@@ -62,7 +62,7 @@
/**
* @return the value failing to pass the constraint.
*/
- Object getValue();
+ Object getInvalidValue();
/**
* @return the list of groups that the triggered constraint applies on and which also
are
Modified: validator/trunk/validation-api/src/main/java/javax/validation/Validator.java
===================================================================
---
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-11-03
22:32:21 UTC (rev 15489)
+++
validator/trunk/validation-api/src/main/java/javax/validation/Validator.java 2008-11-03
23:49:23 UTC (rev 15490)
@@ -32,7 +32,7 @@
* 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) (including group sequence names) targeted for validation
(default to <code>default</code>)
*
* @return constraint violations or an empty Set if none
*
@@ -44,8 +44,8 @@
* 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 propertyName property to validate (ie field and getter constraints)
+ * @param groups group name(s) (including group sequence names) targeted for validation
(default to <code>default</code>)
*
* @return constraint violations or an empty Set if none
*
@@ -61,7 +61,7 @@
*
* @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) (including group sequence names) targeted for validation
(default to <code>default</code>)
*
* @return constraint violations or an empty Set if none
*/