Author: hardy.ferentschik
Date: 2009-08-20 12:11:54 -0400 (Thu, 20 Aug 2009)
New Revision: 17379
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/AnnotationIgnores.java
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/XmlMappingParser.java
Log:
made sure AnotationIgnres uses the right defaults, fixed some typos
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/AnnotationIgnores.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/AnnotationIgnores.java 2009-08-20
14:06:52 UTC (rev 17378)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/metadata/AnnotationIgnores.java 2009-08-20
16:11:54 UTC (rev 17379)
@@ -40,7 +40,7 @@
/**
* Keeps track whether the 'ignore-annotations' flag is set on bean level in the
xml configuration. If 'ignore-annotations'
- * is not specified <code>false</code> is the default.
+ * is not specified <code>true</code> is the default.
*/
private final Map<Class<?>, Boolean> ignoreAnnotationDefaults = new
HashMap<Class<?>, Boolean>();
@@ -55,7 +55,7 @@
public void setDefaultIgnoreAnnotation(Class<?> clazz, Boolean b) {
if ( b == null ) {
- ignoreAnnotationDefaults.put( clazz, Boolean.FALSE );
+ ignoreAnnotationDefaults.put( clazz, Boolean.TRUE );
}
else {
ignoreAnnotationDefaults.put( clazz, b );
Modified:
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/XmlMappingParser.java
===================================================================
---
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/XmlMappingParser.java 2009-08-20
14:06:52 UTC (rev 17378)
+++
validator/trunk/hibernate-validator/src/main/java/org/hibernate/validation/xml/XmlMappingParser.java 2009-08-20
16:11:54 UTC (rev 17379)
@@ -71,7 +71,7 @@
private static final String VALIDATION_MAPPING_XSD =
"META-INF/validation-mapping-1.0.xsd";
private static final String MESSAGE_PARAM = "message";
private static final String GROUPS_PARAM = "groups";
- private static final String PACKAGE_SEPERATOR = ".";
+ private static final String PACKAGE_SEPARATOR = ".";
private final Set<Class<?>> processedClasses = new
HashSet<Class<?>>();
private final ConstraintHelper constraintHelper;
@@ -195,9 +195,9 @@
}
private List<Class<? extends ConstraintValidator<? extends Annotation,
?>>> findConstraintValidatorClasses(Class<? extends Annotation>
annotationType) {
- List<Class<? extends ConstraintValidator<? extends Annotation, ?>>>
constraintValidatorDefinitonClasses = new ArrayList<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>();
+ List<Class<? extends ConstraintValidator<? extends Annotation, ?>>>
constraintValidatorDefinitionClasses = new ArrayList<Class<? extends
ConstraintValidator<? extends Annotation, ?>>>();
if ( constraintHelper.isBuiltinConstraint( annotationType ) ) {
- constraintValidatorDefinitonClasses.addAll( constraintHelper.getBuiltInConstraints(
annotationType ) );
+ constraintValidatorDefinitionClasses.addAll( constraintHelper.getBuiltInConstraints(
annotationType ) );
}
else {
Class<? extends ConstraintValidator<?, ?>>[] validatedBy = annotationType
@@ -208,10 +208,10 @@
//FIXME if yes wrap into VE, if no we need to test the type here
//Once resolved,we can @SuppressWarning("unchecked") on the cast
Class<? extends ConstraintValidator<? extends Annotation, ?>>
safeValidator = validator;
- constraintValidatorDefinitonClasses.add( safeValidator );
+ constraintValidatorDefinitionClasses.add( safeValidator );
}
}
- return constraintValidatorDefinitonClasses;
+ return constraintValidatorDefinitionClasses;
}
private void checkClassHasNotBeenProcessed(Set<Class<?>> processedClasses,
Class<?> beanClass) {
@@ -492,8 +492,8 @@
AnnotationDescriptor<A> annotationDescriptor = new AnnotationDescriptor<A>(
returnType );
for ( ElementType elementType : annotationType.getElement() ) {
String name = elementType.getName();
- Class<?> paramterType = getAnnotationParameterType( returnType, name );
- Object elementValue = getElementValue( elementType, paramterType );
+ Class<?> parameterType = getAnnotationParameterType( returnType, name );
+ Object elementValue = getElementValue( elementType, parameterType );
annotationDescriptor.setValue( name, elementValue );
}
return AnnotationFactory.create( annotationDescriptor );
@@ -579,7 +579,7 @@
private void checkNameIsValid(String name) {
if ( MESSAGE_PARAM.equals( name ) || GROUPS_PARAM.equals( name ) ) {
- throw new ValidationException( MESSAGE_PARAM + " and " + GROUPS_PARAM +
" are reserved paramter names." );
+ throw new ValidationException( MESSAGE_PARAM + " and " + GROUPS_PARAM +
" are reserved parameter names." );
}
}
@@ -601,13 +601,13 @@
fullyQualifiedClass = clazz;
}
else {
- fullyQualifiedClass = defaultPackage + PACKAGE_SEPERATOR + clazz;
+ fullyQualifiedClass = defaultPackage + PACKAGE_SEPARATOR + clazz;
}
return loadClass( fullyQualifiedClass, this.getClass() );
}
private boolean isQualifiedClass(String clazz) {
- return clazz.contains( PACKAGE_SEPERATOR );
+ return clazz.contains( PACKAGE_SEPARATOR );
}
private ConstraintMappingsType getValidationConfig(InputStream in) {
Show replies by date