Author: epbernard
Date: 2008-05-07 10:31:16 -0400 (Wed, 07 May 2008)
New Revision: 14647
Removed:
validator/trunk/src/java/org/hibernate/validator/interpolator/DefaultMessageInterpolatorAggerator.java
Log:
remove class with typo in name
Deleted:
validator/trunk/src/java/org/hibernate/validator/interpolator/DefaultMessageInterpolatorAggerator.java
===================================================================
---
validator/trunk/src/java/org/hibernate/validator/interpolator/DefaultMessageInterpolatorAggerator.java 2008-05-07
07:22:26 UTC (rev 14646)
+++
validator/trunk/src/java/org/hibernate/validator/interpolator/DefaultMessageInterpolatorAggerator.java 2008-05-07
14:31:16 UTC (rev 14647)
@@ -1,57 +0,0 @@
-//$Id: $
-package org.hibernate.validator.interpolator;
-
-import java.lang.annotation.Annotation;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ResourceBundle;
-import java.io.Serializable;
-
-import org.hibernate.validator.MessageInterpolator;
-import org.hibernate.validator.Validator;
-import org.hibernate.AssertionFailure;
-
-/**
- * @author Emmanuel Bernard
- */
-public class DefaultMessageInterpolatorAggerator implements MessageInterpolator,
Serializable {
- private Map<Validator, DefaultMessageInterpolator> interpolators = new
HashMap<Validator, DefaultMessageInterpolator>();
- //transient but repopulated by the object owing a reference to the interpolator
- private transient ResourceBundle messageBundle;
- //transient but repopulated by the object owing a reference to the interpolator
- private transient ResourceBundle defaultMessageBundle;
-
- //not an interface method
- public void initialize(ResourceBundle messageBundle, ResourceBundle
defaultMessageBundle) {
- this.messageBundle = messageBundle;
- this.defaultMessageBundle = defaultMessageBundle;
- //useful when we deserialize
- for ( DefaultMessageInterpolator interpolator : interpolators.values() ) {
- interpolator.initialize( messageBundle, defaultMessageBundle );
- }
- }
-
- public void addInterpolator(Annotation annotation, Validator validator) {
- DefaultMessageInterpolator interpolator = new DefaultMessageInterpolator();
- interpolator.initialize(messageBundle, defaultMessageBundle );
- interpolator.initialize( annotation, null );
- interpolators.put( validator, interpolator );
- }
-
- public String interpolate(String message, Validator validator, MessageInterpolator
defaultInterpolator) {
- DefaultMessageInterpolator defaultMessageInterpolator = interpolators.get( validator
);
- if (defaultMessageInterpolator == null) {
- return message;
- }
- else {
- return defaultMessageInterpolator.interpolate( message, validator, defaultInterpolator
);
- }
- }
-
- public String getAnnotationMessage(Validator validator) {
- DefaultMessageInterpolator defaultMessageInterpolator = interpolators.get( validator
);
- String message = defaultMessageInterpolator != null ?
defaultMessageInterpolator.getAnnotationMessage() : null;
- if (message == null) throw new AssertionFailure("Validator not registred to the
messageInterceptorAggregator");
- return message;
- }
-}
Show replies by date