Author: hardy.ferentschik
Date: 2009-06-26 08:23:06 -0400 (Fri, 26 Jun 2009)
New Revision: 16958
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/BeanMetaDataImpl.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/MetaConstraint.java
Log:
HV-165 - Added toString methods to make debugging easier. Tests for this issue are part of
TCK.
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-06-26
12:20:03 UTC (rev 16957)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/engine/ConstraintTree.java 2009-06-26
12:23:06 UTC (rev 16958)
@@ -289,4 +289,16 @@
throw new ValidationException( "Unable to intialize " +
constraintValidator.getClass().getName(), e );
}
}
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( "ConstraintTree" );
+ sb.append( "{ descriptor=" ).append( descriptor );
+ sb.append( ", parent=" ).append( parent );
+ sb.append( ", children=" ).append( children );
+ sb.append( ", constraintValidatorCache=" ).append( constraintValidatorCache
);
+ sb.append( '}' );
+ return sb.toString();
+ }
}
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/BeanMetaDataImpl.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/BeanMetaDataImpl.java 2009-06-26
12:20:03 UTC (rev 16957)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/BeanMetaDataImpl.java 2009-06-26
12:23:06 UTC (rev 16958)
@@ -395,4 +395,19 @@
}
return metadata;
}
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( "BeanMetaDataImpl" );
+ sb.append( "{beanClass=" ).append( beanClass );
+ sb.append( ", beanDescriptor=" ).append( beanDescriptor );
+ sb.append( ", metaConstraintList=" ).append( metaConstraintList );
+ sb.append( ", cascadedMembers=" ).append( cascadedMembers );
+ sb.append( ", propertyDescriptors=" ).append( propertyDescriptors );
+ sb.append( ", defaultGroupSequence=" ).append( defaultGroupSequence );
+ sb.append( ", constraintHelper=" ).append( constraintHelper );
+ sb.append( '}' );
+ return sb.toString();
+ }
}
\ No newline at end of file
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/MetaConstraint.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/MetaConstraint.java 2009-06-26
12:20:03 UTC (rev 16957)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/MetaConstraint.java 2009-06-26
12:23:06 UTC (rev 16958)
@@ -43,11 +43,6 @@
public class MetaConstraint<T, A extends Annotation> {
/**
- * The constraint tree created from the constraint annotation.
- */
- private final ConstraintTree<A> constraintTree;
-
- /**
* The member the constraint was defined on.
*/
private final Member member;
@@ -68,6 +63,11 @@
*/
private final Class<T> beanClass;
+ /**
+ * The constraint tree created from the constraint annotation.
+ */
+ private final ConstraintTree<A> constraintTree;
+
public MetaConstraint(Class<T> beanClass, ConstraintDescriptor<A>
constraintDescriptor) {
this.elementType = ElementType.TYPE;
this.member = null;
@@ -166,4 +166,17 @@
}
return t;
}
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( "MetaConstraint" );
+ sb.append( "{member=" ).append( member );
+ sb.append( ", propertyName='" ).append( propertyName ).append(
'\'' );
+ sb.append( ", elementType=" ).append( elementType );
+ sb.append( ", beanClass=" ).append( beanClass );
+ sb.append( ", constraintTree=" ).append( constraintTree );
+ sb.append( '}' );
+ return sb.toString();
+ }
}
Show replies by date