incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosv...@apache.org
Subject svn commit: r962601 [3/4] - in /incubator/bval/trunk: bval-core/src/main/java/org/apache/bval/ bval-core/src/main/java/org/apache/bval/model/ bval-core/src/main/java/org/apache/bval/routines/ bval-core/src/main/java/org/apache/bval/util/ bval-jsr303/sr...
Date Fri, 09 Jul 2010 16:31:18 GMT
Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/ElementDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -47,20 +47,33 @@ public abstract class ElementDescriptorI
         createConstraintDescriptors(validations);
     }
 
-    /** @return Statically defined returned type. */
+    /**
+     * {@inheritDoc}
+     *  @return Statically defined returned type.
+     */
     public Class<?> getElementClass() {
         return elementClass;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
     public ElementDescriptor.ConstraintFinder findConstraints() {
-        return new ConstraintFinderImpl(metaBean, constraintDescriptors);
+        return new ConstraintFinderImpl(metaBean, (Set) constraintDescriptors);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Set<ConstraintDescriptor<?>> getConstraintDescriptors() {
         return constraintDescriptors;
     }
 
-    /** return true if at least one constraint declaration is present on the element. */
+    /**
+     * {@inheritDoc}
+     * return true if at least one constraint declaration is present on the element.
+     */
     public boolean hasConstraints() {
         return !constraintDescriptors.isEmpty();
     }
@@ -68,18 +81,26 @@ public abstract class ElementDescriptorI
     private void createConstraintDescriptors(Validation[] validations) {
         final Set<ConstraintDescriptor<?>> cds = new HashSet<ConstraintDescriptor<?>>(validations.length);
         for (Validation validation : validations) {
-            if (validation instanceof ConstraintValidation) {
-                ConstraintValidation cval = (ConstraintValidation) validation;
+            if (validation instanceof ConstraintValidation<?>) {
+                ConstraintValidation<?> cval = (ConstraintValidation<?>) validation;
                 cds.add(cval);
             }
         }
         setConstraintDescriptors(cds);
     }
 
+    /**
+     * Set the constraintDescriptors for this element.
+     * @param constraintDescriptors to set
+     */
     public void setConstraintDescriptors(Set<ConstraintDescriptor<?>> constraintDescriptors) {
         this.constraintDescriptors = constraintDescriptors;
     }
 
+    /**
+     * Get the model {@link MetaBean} used.
+     * @return MetaBean
+     */
     public MetaBean getMetaBean() {
         return metaBean;
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GraphBeanIdentity.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GraphBeanIdentity.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GraphBeanIdentity.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GraphBeanIdentity.java Fri Jul  9 16:31:15 2010
@@ -28,8 +28,8 @@ package org.apache.bval.jsr303;
  * <li>The current group being validated.</li>
  * </ul>
  * 
- * FIXME: Owner is currently not used in identity checking, and probably won't
- * never be. So it is likely to be deleted.
+ * FIXME: Owner is currently not used in identity checking, and probably
+ * never will be.  So it is likely to be deleted.
  * 
  * @author Carlos Vara
  */
@@ -39,24 +39,45 @@ public class GraphBeanIdentity {
     private final Class<?> group;
     private final Class<?> owner;
 
+    /**
+     * Create a new GraphBeanIdentity instance.
+     * @param bean
+     * @param group
+     * @param owner
+     */
     public GraphBeanIdentity(Object bean, Class<?> group, Class<?> owner) {
         this.bean = bean;
         this.group = group;
         this.owner = owner;
     }
     
+    /**
+     * Get the bean.
+     * @return Object
+     */
     public Object getBean() {
         return bean;
     }
 
+    /**
+     * Get the group being validated.
+     * @return Class
+     */
     public Class<?> getGroup() {
         return group;
     }
 
+    /**
+     * Get the owning class
+     * @return
+     */
     public Class<?> getOwner() {
         return owner;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public boolean equals(Object obj) {
 
@@ -92,6 +113,9 @@ public class GraphBeanIdentity {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public int hashCode() {
         final int prime = 31;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContext.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContext.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContext.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContext.java Fri Jul  9 16:31:15 2010
@@ -29,37 +29,95 @@ import javax.validation.MessageInterpola
 import javax.validation.TraversableResolver;
 
 /**
- * Description: <br/>
+ * Description: JSR-303 {@link ValidationContext} extension. <br/>
  */
 public interface GroupValidationContext<T extends ValidationListener>
       extends ValidationContext<T> {
-    /** the groups in their sequence for validation */
+    
+    /**
+     * Get the groups of this {@link GroupValidationContext}.
+     * @return the groups in their sequence for validation
+     */
     Groups getGroups();
 
+    /**
+     * Set the current {@link Group}.
+     * @param group to set
+     */
     void setCurrentGroup(Group group);
 
+    /**
+     * Get the current {@link Group}.
+     * @return Group
+     */
     Group getCurrentGroup();
 
+    /**
+     * Get the property path.
+     * @return {@link PathImpl}
+     */
     PathImpl getPropertyPath();
 
+    /**
+     * Get the root {@link MetaBean}.
+     * @return {@link MetaBean}
+     */
     MetaBean getRootMetaBean();
 
-    void setConstraintValidation(ConstraintValidation constraint);
-
-    public ConstraintValidation getConstraintValidation();
-
-    public Object getValidatedValue();
-
+    /**
+     * Set the {@link ConstraintValidation}.
+     * @param constraint to set
+     */
+    void setConstraintValidation(ConstraintValidation<?> constraint);
+
+    /**
+     * Get the {@link ConstraintValidation}.
+     * @return {@link ConstraintValidation}
+     */
+    ConstraintValidation<?> getConstraintValidation();
+
+    /**
+     * Get the value being validated.
+     * @return Object
+     */
+    Object getValidatedValue();
+
+    /**
+     * Set a fixed value for the context.
+     * @param value to set
+     */
     void setFixedValue(Object value);
 
+    /**
+     * Get the message resolver.
+     * @return {@link MessageInterpolator}
+     */
     MessageInterpolator getMessageResolver();
 
+    /**
+     * Get the {@link TraversableResolver}.
+     * @return {@link TraversableResolver}
+     */
     TraversableResolver getTraversableResolver();
 
-    boolean collectValidated(ConstraintValidator constraint);
-    
+    /**
+     * Accumulate a validated constraint.
+     * @param constraint
+     * @return true when the constraint for the object in this path was not
+     *         already validated in this context
+     */
+    boolean collectValidated(ConstraintValidator<?, ?> constraint);
+
+    /**
+     * Get the current owning class.
+     * @return Class
+     */
     Class<?> getCurrentOwner();
-    
+
+    /**
+     * Set the current owning class.
+     * @param currentOwner to set
+     */
     void setCurrentOwner(Class<?> currentOwner);
 
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContextImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContextImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/GroupValidationContextImpl.java Fri Jul  9 16:31:15 2010
@@ -46,6 +46,7 @@ final class GroupValidationContextImpl<T
   private final MessageInterpolator messageResolver;
   private final PathImpl path;
   private final MetaBean rootMetaBean;
+
   /**
    * the groups in the sequence of validation to take place
    */
@@ -64,9 +65,16 @@ final class GroupValidationContextImpl<T
   private HashSet<ConstraintValidatorIdentity> validatedConstraints =
       new HashSet<ConstraintValidatorIdentity>();
 
-  private ConstraintValidation constraintValidation;
+  private ConstraintValidation<?> constraintValidation;
   private final TraversableResolver traversableResolver;
 
+  /**
+   * Create a new GroupValidationContextImpl instance.
+   * @param listener
+   * @param aMessageResolver
+   * @param traversableResolver
+   * @param rootMetaBean
+   */
   public GroupValidationContextImpl(T listener, MessageInterpolator aMessageResolver,
                                     TraversableResolver traversableResolver,
                                     MetaBean rootMetaBean) {
@@ -78,22 +86,34 @@ final class GroupValidationContextImpl<T
     this.path = PathImpl.create(null);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void setCurrentIndex(Integer index) {
     path.getLeafNode().setIndex(index);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void setCurrentKey(Object key) {
     path.getLeafNode().setKey(key);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void moveDown(MetaProperty prop, AccessStrategy access) {
     path.addNode(new NodeImpl(prop.getName()));
     super.moveDown(prop, access);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void moveUp(Object bean, MetaBean metaBean) {
     path.removeLeafNode();
@@ -101,13 +121,10 @@ final class GroupValidationContextImpl<T
   }
 
   /**
-   * add the object in the current group to the collection of validated
-   * objects to keep track of them to avoid endless loops during validation.
-   * <p/>
-   * NOTE: No longer uses the inherited validatedObjects hashmap
-   *
-   * @return true when the object was not already validated in this context
+   * {@inheritDoc}
+   * Here, state equates to bean identity + group.
    */
+  @SuppressWarnings("unchecked")
   @Override
   public boolean collectValidated() {
 
@@ -134,20 +151,23 @@ final class GroupValidationContextImpl<T
   }
 
   /**
-   * @return true when the constraint for the object in this path was not
-   *         already validated in this context
+   * {@inheritDoc}
    */
-  public boolean collectValidated(ConstraintValidator constraint) {
+  public boolean collectValidated(ConstraintValidator<?, ?> constraint) {
     ConstraintValidatorIdentity cvi = new ConstraintValidatorIdentity(getBean(), getPropertyPath(), constraint);
     return this.validatedConstraints.add(cvi);
   }
 
+  /**
+   * Reset the validated constraints.
+   */
   public void resetValidatedConstraints() {
     validatedConstraints.clear();
   }
 
   /**
-   * if an associated object is validated,
+   * {@inheritDoc}
+   * If an associated object is validated,
    * add the association field or JavaBeans property name and a dot ('.') as a prefix
    * to the previous rules.
    * uses prop[index] in property path for elements in to-many-relationships.
@@ -162,40 +182,65 @@ final class GroupValidationContextImpl<T
     return currentPath;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public MetaBean getRootMetaBean() {
     return rootMetaBean;
   }
 
+  /**
+   * Set the Groups.
+   * @param groups
+   */
   public void setGroups(Groups groups) {
     this.groups = groups;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public Groups getGroups() {
     return groups;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public Group getCurrentGroup() {
     return currentGroup;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public void setCurrentGroup(Group currentGroup) {
     this.currentGroup = currentGroup;
   }
 
-  public void setConstraintValidation(ConstraintValidation constraint) {
+  /**
+   * {@inheritDoc}
+   */
+  public void setConstraintValidation(ConstraintValidation<?> constraint) {
     constraintValidation = constraint;
   }
 
-  public ConstraintValidation getConstraintValidation() {
+  /**
+   * {@inheritDoc}
+   */
+  public ConstraintValidation<?> getConstraintValidation() {
     return constraintValidation;
   }
 
-  public ConstraintDescriptor getConstraintDescriptor() {
+  /**
+   * {@inheritDoc}
+   */
+  public ConstraintDescriptor<?> getConstraintDescriptor() {
     return constraintValidation;
   }
 
   /**
-   * @return value being validated
+   * {@inheritDoc}
    */
   public Object getValidatedValue() {
     if (getMetaProperty() != null) {
@@ -205,19 +250,30 @@ final class GroupValidationContextImpl<T
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public MessageInterpolator getMessageResolver() {
     return messageResolver;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public TraversableResolver getTraversableResolver() {
     return traversableResolver;
   }
 
-
+  /**
+   * {@inheritDoc}
+   */
   public Class<?> getCurrentOwner() {
     return this.currentOwner;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public void setCurrentOwner(Class<?> currentOwner) {
     this.currentOwner = currentOwner;
   }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303Features.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303Features.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303Features.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303Features.java Fri Jul  9 16:31:15 2010
@@ -28,11 +28,17 @@ import org.apache.bval.model.Features;
  * @see org.apache.bval.model.Features
  */
 public interface Jsr303Features {
+    /**
+     * JSR303 Property features
+     */
     interface Property extends Features.Property {
         /** INFO: cached PropertyDescriptorImpl of the property */
         String PropertyDescriptor = "PropertyDescriptor";
     }
 
+    /**
+     * JSR303 bean features
+     */
     interface Bean extends Features.Bean {
         /**
          * INFO: List of Group(Class) for {@link javax.validation.GroupSequence#value()}

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/Jsr303MetaBeanFactory.java Fri Jul  9 16:31:15 2010
@@ -52,10 +52,17 @@ import java.util.Set;
  * mappings (defined in xml)<br/>
  */
 public class Jsr303MetaBeanFactory implements MetaBeanFactory {
+    /** Shared log instance */ //of dubious utility as it's static :/
     protected static final Log log = LogFactory.getLog(Jsr303MetaBeanFactory.class);
+    /** Constant for the "value" annotation attribute specified in JSR303*/
     protected static final String ANNOTATION_VALUE = "value";
+    /** {@link ApacheFactoryContext} used */
     protected final ApacheFactoryContext factoryContext;
 
+    /**
+     * Create a new Jsr303MetaBeanFactory instance.
+     * @param factoryContext
+     */
     public Jsr303MetaBeanFactory(ApacheFactoryContext factoryContext) {
         this.factoryContext = factoryContext;
     }
@@ -66,12 +73,12 @@ public class Jsr303MetaBeanFactory imple
 
     private ConstraintDefaults getDefaultConstraints() {
         return factoryContext.getFactory().getDefaultConstraints();
-
     }
 
     /**
-     * add the validation features to the metabean that come from jsr303
-     * annotations in the beanClass
+     * {@inheritDoc}
+     * Add the validation features to the metabean that come from JSR303
+     * annotations in the beanClass.
      */
     public void buildMetaBean(MetaBean metabean) {
         try {
@@ -99,8 +106,9 @@ public class Jsr303MetaBeanFactory imple
     }
 
     /**
-     * process class annotations, field and method annotations
-     *
+     * Process class annotations, field and method annotations.
+     * @param beanClass
+     * @param metabean
      * @throws IllegalAccessException
      * @throws InvocationTargetException
      */
@@ -164,7 +172,12 @@ public class Jsr303MetaBeanFactory imple
 
         addXmlConstraints(beanClass, metabean);
     }
-    
+
+    /**
+     * Learn whether a given Method has validation constraints defined via JSR303 annotations.
+     * @param method
+     * @return <code>true</code> if constraints detected
+     */
     protected boolean hasValidationConstraintsDefined(Method method) {
         boolean ret = false;
         for ( Annotation annot : method.getDeclaredAnnotations() ) {
@@ -172,10 +185,9 @@ public class Jsr303MetaBeanFactory imple
                 break;
             }
         }
-        
         return ret;
     }
-    
+
     private boolean hasValidationConstraintsDefined(Annotation annot) {
         // If it is annotated with @Constraint
         if ( annot.annotationType().getAnnotation(Constraint.class) != null ) {
@@ -204,7 +216,14 @@ public class Jsr303MetaBeanFactory imple
         return ret;
     }
 
-    /** add cascade validation and constraints from xml mappings */
+    /**
+     * Add cascade validation and constraints from xml mappings
+     * @param beanClass
+     * @param metabean
+     * @throws IllegalAccessException
+     * @throws InvocationTargetException
+     */
+    @SuppressWarnings("unchecked")
     private void addXmlConstraints(Class<?> beanClass, MetaBean metabean)
           throws IllegalAccessException, InvocationTargetException {
         for (MetaConstraint<?, ? extends Annotation> meta : factoryContext.getFactory()
@@ -221,11 +240,14 @@ public class Jsr303MetaBeanFactory imple
                           meta.getAccessStrategy().getJavaType());
                 }
             }
-            Class<? extends ConstraintValidator<?, ?>>[] constraintClasses =
+            Class<? extends ConstraintValidator<? extends Annotation, ?>>[] constraintClasses =
                   findConstraintValidatorClasses(meta.getAnnotation(), null);
-            applyConstraint(meta.getAnnotation(), constraintClasses, metaProperty, beanClass,
-                  meta.getAccessStrategy(), new AppendValidationToMeta(
-                  metaProperty == null ? metabean : metaProperty));
+            applyConstraint(
+                    (Annotation) meta.getAnnotation(),
+                    (Class<? extends ConstraintValidator<Annotation, ?>>[]) constraintClasses,
+                    metaProperty, beanClass, meta.getAccessStrategy(),
+                    new AppendValidationToMeta(metaProperty == null ? metabean
+                            : metaProperty));
         }
         for (AccessStrategy access : factoryContext.getFactory().getValidAccesses(beanClass)) {
             MetaProperty metaProperty = metabean.getProperty(access.getPropertyName());
@@ -258,7 +280,7 @@ public class Jsr303MetaBeanFactory imple
         return changed;
     }
 
-    private boolean processAnnotation(Annotation annotation, MetaProperty prop, Class<?> owner,
+    private <A extends Annotation> boolean processAnnotation(A annotation, MetaProperty prop, Class<?> owner,
                                       AccessStrategy access, AppendValidation appender)
           throws IllegalAccessException, InvocationTargetException {
         if (annotation instanceof Valid) {
@@ -272,7 +294,7 @@ public class Jsr303MetaBeanFactory imple
             Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
             if (vcAnno != null) {
                 ConstraintDefinitionValidator.validateConstraintDefinition(annotation);
-                Class<? extends ConstraintValidator<?, ?>>[] validatorClasses;
+                Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
                 validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
                 return applyConstraint(annotation, validatorClasses, prop, owner, access,
                       appender);
@@ -297,20 +319,28 @@ public class Jsr303MetaBeanFactory imple
         return false;
     }
 
-    protected Class<? extends ConstraintValidator<?, ?>>[] findConstraintValidatorClasses(
-          Annotation annotation, Constraint vcAnno) {
+    /**
+     * Find available {@link ConstraintValidation} classes for a given constraint annotation.
+     * @param annotation
+     * @param vcAnno
+     * @return {@link ConstraintValidation} implementation class array
+     */
+    @SuppressWarnings("unchecked")
+    protected <A extends Annotation> Class<? extends ConstraintValidator<A, ?>>[] findConstraintValidatorClasses(
+          A annotation, Constraint vcAnno) {
         if (vcAnno == null) {
             vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
         }
-        Class<? extends ConstraintValidator<?, ?>>[] validatorClasses;
+        Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
+        Class<A> annotationType = (Class<A>) annotation.annotationType();
         validatorClasses = factoryContext.getFactory()
               .getConstraintsCache()
-              .getConstraintValidators(annotation.annotationType());
+              .getConstraintValidators(annotationType);
         if (validatorClasses == null) {
-            validatorClasses = vcAnno.validatedBy();
+            validatorClasses = (Class<? extends ConstraintValidator<A, ?>>[]) vcAnno.validatedBy();
             if (validatorClasses.length == 0) {
                 validatorClasses = getDefaultConstraints()
-                      .getValidatorClasses(annotation.annotationType());
+                      .getValidatorClasses(annotationType);
             }
         }
         return validatorClasses;
@@ -380,16 +410,28 @@ public class Jsr303MetaBeanFactory imple
     }
 
     /**
+     * Apply a constraint to the specified <code>appender</code>.
+     * @param annotation constraint annotation
+     * @param constraintClasses known {@link ConstraintValidator} implementation classes for <code>annotation</code>
+     * @param prop meta-property
+     * @param owner type
+     * @param access strategy
+     * @param appender
+     * @return success flag
+     * @throws IllegalAccessException
+     * @throws InvocationTargetException
+     */
+    /*
      * @throws IllegalAccessException
      * @throws InvocationTargetException
      */
-    protected boolean applyConstraint(Annotation annotation,
-                                      Class<? extends ConstraintValidator<?, ?>>[] constraintClasses,
+    protected <A extends Annotation> boolean applyConstraint(A annotation,
+                                      Class<? extends ConstraintValidator<A, ?>>[] constraintClasses,
                                       MetaProperty prop, Class<?> owner, AccessStrategy access,
                                       AppendValidation appender)
           throws IllegalAccessException, InvocationTargetException {
 
-        final ConstraintValidator validator;
+        final ConstraintValidator<A, ?> validator;
         if (constraintClasses != null && constraintClasses.length > 0) {
             Type type = determineTargetedType(owner, access);
             /**
@@ -401,8 +443,8 @@ public class Jsr303MetaBeanFactory imple
              * supertype of T and not a supertype of the chosen
              * ConstraintValidator supported type.
              */
-            Map<Type, Class<? extends ConstraintValidator<?, ?>>> validatorTypes =
-                  TypeUtils.getValidatorsTypes(constraintClasses);
+            Map<Type, Class<? extends ConstraintValidator<A, ?>>> validatorTypes =
+                  (Map<Type, Class<? extends ConstraintValidator<A, ?>>>) TypeUtils.getValidatorsTypes(constraintClasses);
             final List<Type> assignableTypes = new ArrayList<Type>(constraintClasses.length);
             fillAssignableTypes(type, validatorTypes.keySet(), assignableTypes);
             reduceAssignableTypes(assignableTypes);
@@ -416,7 +458,7 @@ public class Jsr303MetaBeanFactory imple
         } else {
             validator = null;
         }
-        final AnnotationConstraintBuilder builder = new AnnotationConstraintBuilder(
+        final AnnotationConstraintBuilder<A> builder = new AnnotationConstraintBuilder<A>(
               constraintClasses, validator, annotation, owner, access);
 
         // JSR-303 3.4.4: Add implicit groups

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/NestedMetaProperty.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/NestedMetaProperty.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/NestedMetaProperty.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/NestedMetaProperty.java Fri Jul  9 16:31:15 2010
@@ -38,12 +38,20 @@ final class NestedMetaProperty {
     private boolean nested;
     private Object value;
 
+    /**
+     * Create a new NestedMetaProperty instance.
+     * @param path
+     * @param value
+     */
     public NestedMetaProperty(String path, Object value) {
         this.propertyPath = path;
         this.value = value;
     }
 
-     void parse() {
+    /**
+     * Parse this {@link NestedMetaProperty}.
+     */
+    void parse() {
         try {
             StringTokenizer tokens = new StringTokenizer(propertyPath, ".[]", true);
             while (tokens.hasMoreTokens()) {
@@ -80,18 +88,34 @@ final class NestedMetaProperty {
         }
     }
 
+    /**
+     * Get the resolved MetaProperty.
+     * @return MetaProperty
+     */
     public MetaProperty getMetaProperty() {
         return metaProperty;
     }
 
+    /**
+     * Get the property path.
+     * @return String path
+     */
     public String getPropertyPath() {
         return propertyPath;
     }
 
+    /**
+     * Learn whether the {@link MetaProperty} represented is indeed nested.
+     * @return boolean
+     */
     public boolean isNested() {
         return nested;
     }
 
+    /**
+     * Set the MetaProperty directly
+     * @param aMetaProperty to set
+     */
     public void setMetaProperty(MetaProperty aMetaProperty) {
         if (this.metaProperty != null) {
             this.nested = true;
@@ -99,18 +123,34 @@ final class NestedMetaProperty {
         this.metaProperty = aMetaProperty;
     }
 
+    /**
+     * Get the resolved MetaBean.
+     * @return MetaBean
+     */
     public MetaBean getMetaBean() {
         return metaBean;
     }
 
+    /**
+     * Set the MetaBean directly
+     * @param metaBean to set
+     */
     public void setMetaBean(MetaBean metaBean) {
         this.metaBean = metaBean;
     }
 
+    /**
+     * Get the property value referenced.
+     * @return Object
+     */
     public Object getValue() {
         return value;
     }
 
+    /**
+     * Set the property value directly.
+     * @param value to set
+     */
     public void setValue(Object value) {
         this.value = value;
     }
@@ -134,6 +174,11 @@ final class NestedMetaProperty {
         }
     }
 
+    /**
+     * Get the declared type of a Member.
+     * @param member
+     * @return generic type
+     */
     static Type typeOf(Member member) {
         if (member instanceof Field) {
             return ((Field) member).getGenericType();
@@ -144,6 +189,11 @@ final class NestedMetaProperty {
         throw new IllegalArgumentException("Member " + member + " is neither a field nor a method");
     }
 
+    /**
+     * Get the component type of an indexed type.
+     * @param type
+     * @return Type
+     */
     static Type getIndexedType(Type type) {
         Type indexedType = type;
         if (isCollection(type) && type instanceof ParameterizedType) {
@@ -161,6 +211,12 @@ final class NestedMetaProperty {
         return indexedType;
     }
 
+    /**
+     * Resolve the raw type of a Collection.
+     * @param type
+     * @return Class if found
+     */
+    @SuppressWarnings("unchecked")
     static Class<? extends Collection<?>> getCollectionClass(Type type) {
         if (type instanceof Class<?> && isCollectionClass((Class<?>) type)) {
             return (Class<? extends Collection<?>>) type;
@@ -178,6 +234,11 @@ final class NestedMetaProperty {
         return null;
     }
 
+    /**
+     * Learn whether a particular type represents an array.
+     * @param type
+     * @return boolean
+     */
     static boolean isArray(Type type) {
         if (type instanceof Class<?>) {
             return ((Class<?>) type).isArray();
@@ -186,6 +247,7 @@ final class NestedMetaProperty {
     }
 
     /**
+     * Learn whether <code>type</code> is a {@link Collection} type.
      * @param type the type to check.
      * @return Returns <code>true</code> if <code>type</code> is a collection type or <code>false</code> otherwise.
      */
@@ -193,6 +255,12 @@ final class NestedMetaProperty {
         return getCollectionClass(type) != null;
     }
 
+    /**
+     * Learn whether <code>clazz</code> implements either {@link Collection} or {@link Map}.
+     * @param clazz
+     * @return boolean
+     */
+    //TODO should all these Collection references be Iterable?
     static boolean isCollectionClass(Class<?> clazz) {
         return Collection.class.isAssignableFrom(clazz) || Map.class.isAssignableFrom(clazz);
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/PropertyDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/PropertyDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/PropertyDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/PropertyDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -26,36 +26,64 @@ import org.apache.bval.model.Validation;
 
 
 /**
- * Description: <br/>
+ * Description: {@link PropertyDescriptor} implementation.<br/>
  */
 class PropertyDescriptorImpl extends ElementDescriptorImpl implements PropertyDescriptor {
     private boolean cascaded;
     private String propertyPath;
 
+    /**
+     * Create a new PropertyDescriptorImpl instance.
+     * @param metaBean
+     * @param propertyPath
+     * @param validations
+     */
     PropertyDescriptorImpl(MetaBean metaBean, String propertyPath, Validation[] validations) {
         super(metaBean, metaBean.getProperty(propertyPath).getTypeClass(), validations);
     }
 
+    /**
+     * Create a new PropertyDescriptorImpl instance.
+     * @param elementClass
+     * @param validations
+     */
     PropertyDescriptorImpl(Class<?> elementClass, Validation[] validations) {
         super(elementClass, validations);
     }
 
+    /**
+     * Set whether the referenced property is cascaded.
+     * @param cascaded
+     */
     public void setCascaded(boolean cascaded) {
         this.cascaded = cascaded;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascaded() {
         return cascaded;
     }
 
+    /**
+     * Set the referenced property path.
+     * @param propertyPath
+     */
     public void setPropertyPath(String propertyPath) {
         this.propertyPath = propertyPath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String getPropertyName() {
         return propertyPath;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public String toString() {
         return "PropertyDescriptorImpl{" + "returnType=" + elementClass + ", propertyPath='" +
               propertyPath + '\'' + '}';

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/UnknownPropertyException.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/UnknownPropertyException.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/UnknownPropertyException.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/UnknownPropertyException.java Fri Jul  9 16:31:15 2010
@@ -30,18 +30,34 @@ public class UnknownPropertyException ex
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * Create a new UnknownPropertyException instance.
+     * @param message
+     */
     public UnknownPropertyException(String message) {
         super(message);
     }
 
+    /**
+     * Create a new UnknownPropertyException instance.
+     */
     public UnknownPropertyException() {
         super();
     }
 
+    /**
+     * Create a new UnknownPropertyException instance.
+     * @param message
+     * @param cause
+     */
     public UnknownPropertyException(String message, Throwable cause) {
         super(message, cause);
     }
 
+    /**
+     * Create a new UnknownPropertyException instance.
+     * @param cause
+     */
     public UnknownPropertyException(Throwable cause) {
         super(cause);
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/AppendValidationToList.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/AppendValidationToList.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/AppendValidationToList.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/AppendValidationToList.java Fri Jul  9 16:31:15 2010
@@ -17,6 +17,7 @@
 package org.apache.bval.jsr303.extensions;
 
 
+import org.apache.bval.jsr303.AppendValidation;
 import org.apache.bval.jsr303.BaseAppendValidation;
 import org.apache.bval.jsr303.ConstraintValidation;
 
@@ -25,18 +26,29 @@ import java.util.ArrayList;
 import java.util.List;
 
 /**
- * Description: <br/>
+ * Description: {@link AppendValidation} implementation that acts as an intermediate
+ * cache of validations for further processing.<br/>
  */
 public class AppendValidationToList extends BaseAppendValidation {
     private final List<ConstraintValidation<? extends Annotation>> validations = new ArrayList<ConstraintValidation<? extends Annotation>>();
 
+    /**
+     * Create a new AppendValidationToList instance.
+     */
     public AppendValidationToList() {
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public <T extends Annotation> void performAppend(ConstraintValidation<T> validation) {
         validations.add(validation);
     }
 
+    /**
+     * Get the list of cached validations.
+     * @return {@link List} of {@link ConstraintValidation}
+     */
     public List<ConstraintValidation<? extends Annotation>> getValidations() {
         return validations;
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptor.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptor.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptor.java Fri Jul  9 16:31:15 2010
@@ -24,7 +24,15 @@ import java.util.List;
  * functionality is part of the JSR303 specification.<br/>
  */
 public interface ConstructorDescriptor extends ElementDescriptor {
+    /**
+     * Get the list of {@link ParameterDescriptor}s.
+     * @return {@link List} of {@link ParameterDescriptor}
+     */
     List<ParameterDescriptor> getParameterDescriptors(); //index aligned
 
+    /**
+     * Learn whether the referenced constructor should be validated.
+     * @return
+     */
     boolean isCascaded();
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ConstructorDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -25,30 +25,48 @@ import org.apache.bval.model.MetaBean;
 import org.apache.bval.model.Validation;
 
 /**
- * Description: <br/>
+ * Description: {@link ConstructorDescriptor} implementation.<br/>
  */
 public class ConstructorDescriptorImpl extends ElementDescriptorImpl
       implements ConstructorDescriptor, ProcedureDescriptor {
     private final List<ParameterDescriptor> parameterDescriptors = new ArrayList<ParameterDescriptor>();
     private boolean cascaded;
 
+    /**
+     * Create a new ConstructorDescriptorImpl instance.
+     * @param metaBean
+     * @param validations
+     */
     protected ConstructorDescriptorImpl(MetaBean metaBean, Validation[] validations) {
         super(metaBean, metaBean.getBeanClass(), validations);
     }
 
+    /**
+     * Create a new ConstructorDescriptorImpl instance.
+     * @param elementClass
+     * @param validations
+     */
     protected ConstructorDescriptorImpl(Class<?> elementClass, Validation[] validations) {
         super(elementClass, validations);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascaded() {
         return cascaded;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setCascaded(boolean cascaded) {
         this.cascaded = cascaded;
     }
 
-
+    /**
+     * {@inheritDoc}
+     */
     public List<ParameterDescriptor> getParameterDescriptors() //index aligned
     {
         return parameterDescriptors;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptor.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptor.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptor.java Fri Jul  9 16:31:15 2010
@@ -22,15 +22,34 @@ import java.lang.reflect.Method;
 import java.util.Set;
 
 /**
- * Description: This class will disappear when such
+ * Description: Provides method/constructor-related constraint information
+ * for a type.  This class will disappear when such
  * functionality is part of the JSR303 specification.<br/>
  */
 public interface MethodBeanDescriptor extends BeanDescriptor {
+    /**
+     * Get the constraints that apply to a particular method.
+     * @param method
+     * @return {@link MethodDescriptor}
+     */
     MethodDescriptor getConstraintsForMethod(Method method);
 
+    /**
+     * Get the constraints that apply to a particular constructor.
+     * @param constructor
+     * @return {@link ConstructorDescriptor}
+     */
     ConstructorDescriptor getConstraintsForConstructor(Constructor<?> constructor);
 
+    /**
+     * Get the set of constrained methods.
+     * @return {@link Set} of {@link MethodDescriptor}
+     */
     Set<MethodDescriptor> getConstrainedMethods();
 
+    /**
+     * Get the set of constrained constructors.
+     * @return {@link Set} of {@link ConstructorDescriptor}
+     */
     Set<ConstructorDescriptor> getConstrainedConstructors();
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodBeanDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -29,55 +29,99 @@ import org.apache.bval.model.MetaBean;
 import org.apache.bval.model.Validation;
 
 /**
- * Description: <br/>
+ * Description: {@link MethodBeanDescriptor} implementation.<br/>
  */
 class MethodBeanDescriptorImpl extends BeanDescriptorImpl
       implements MethodBeanDescriptor {
     private Map<Method, MethodDescriptor> methodConstraints;
     private Map<Constructor<?>, ConstructorDescriptor> constructorConstraints;
 
+    /**
+     * Create a new MethodBeanDescriptorImpl instance.
+     * @param factoryContext
+     * @param metaBean
+     * @param validations
+     */
     protected MethodBeanDescriptorImpl(ApacheFactoryContext factoryContext,
                                        MetaBean metaBean, Validation[] validations) {
         super(factoryContext, metaBean, validations);
     }
 
+    /**
+     * Set the map of method constraints for this bean.
+     * @param methodConstraints
+     */
     public void setMethodConstraints(Map<Method, MethodDescriptor> methodConstraints) {
         this.methodConstraints = methodConstraints;
     }
 
+    /**
+     * Set the map of constructor constraints for this bean.
+     * @param constructorConstraints
+     */
     public void setConstructorConstraints(
           Map<Constructor<?>, ConstructorDescriptor> constructorConstraints) {
         this.constructorConstraints = constructorConstraints;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public MethodDescriptor getConstraintsForMethod(Method method) {
         return methodConstraints.get(method);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public ConstructorDescriptor getConstraintsForConstructor(Constructor<?> constructor) {
         return constructorConstraints.get(constructor);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Set<MethodDescriptor> getConstrainedMethods() {
         return new HashSet<MethodDescriptor>(methodConstraints.values());
     }
 
+    /**
+     * Add a {@link MethodDescriptor} to this {@link MethodBeanDescriptorImpl}.
+     * @param method
+     * @param desc
+     */
     public void putMethodDescriptor(Method method, MethodDescriptor desc) {
         methodConstraints.put(method, desc);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public Set<ConstructorDescriptor> getConstrainedConstructors() {
         return new HashSet<ConstructorDescriptor>(this.constructorConstraints.values());
     }
 
+    /**
+     * Add a {@link ConstructorDescriptor} to this {@link MethodBeanDescriptorImpl}.
+     * @param cons
+     * @param desc
+     */
     public void putConstructorDescriptor(Constructor<?> cons, ConstructorDescriptor desc) {
         constructorConstraints.put(cons, desc);
     }
 
+    /**
+     * Get the configured method constraints.
+     * @return {@link Map} of {@link Method} : {@link MethodDescriptor}
+     */
     public Map<Method, MethodDescriptor> getMethodConstraints() {
         return methodConstraints;
     }
 
+    /**
+     * Get the configured constructor constraints.
+     * @return {@link Map} of {@link Constructor} : {@link ConstructorDescriptor}
+     */
     public Map<Constructor<?>, ConstructorDescriptor> getConstructorConstraints() {
         return constructorConstraints;
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptor.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptor.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptor.java Fri Jul  9 16:31:15 2010
@@ -24,8 +24,16 @@ import java.util.List;
  * functionality is part of the JSR303 specification.<br/>
  */
 public interface MethodDescriptor extends ElementDescriptor {
+    /**
+     * Get the {@link ParameterDescriptor}s for this {@link MethodDescriptor}.
+     * @return {@link List} of {@link ParameterDescriptor}
+     */
     List<ParameterDescriptor> getParameterDescriptors(); //index aligned
 
+    /**
+     * Learn whether the referenced method should be validated.
+     * @return boolean
+     */
     boolean isCascaded();
 
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -25,30 +25,49 @@ import org.apache.bval.model.MetaBean;
 import org.apache.bval.model.Validation;
 
 /**
- * Description: <br/>
+ * Description: {@link MethodDescriptor} implementation.<br/>
  */
 public class MethodDescriptorImpl extends ElementDescriptorImpl
       implements MethodDescriptor, ProcedureDescriptor {
     private final List<ParameterDescriptor> parameterDescriptors = new ArrayList<ParameterDescriptor>();
     private boolean cascaded;
 
+    /**
+     * Create a new MethodDescriptorImpl instance.
+     * @param metaBean
+     * @param validations
+     */
     protected MethodDescriptorImpl(MetaBean metaBean, Validation[] validations) {
         super(metaBean, metaBean.getClass(), validations);
     }
 
+    /**
+     * Create a new MethodDescriptorImpl instance.
+     * @param elementClass
+     * @param validations
+     */
     protected MethodDescriptorImpl(Class<?> elementClass, Validation[] validations) {
         super(elementClass, validations);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public List<ParameterDescriptor> getParameterDescriptors() //index aligned
     {
         return parameterDescriptors;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascaded() {
         return cascaded;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public void setCascaded(boolean cascaded) {
         this.cascaded = cascaded;
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorImpl.java Fri Jul  9 16:31:15 2010
@@ -36,6 +36,10 @@ import java.util.Set;
  * Description: experimental implementation of method-level-validation <br/>
  */
 class MethodValidatorImpl extends ClassValidator implements MethodValidator {
+  /**
+   * Create a new MethodValidatorImpl instance.
+   * @param factoryContext
+   */
   public MethodValidatorImpl(ApacheFactoryContext factoryContext) {
     super(factoryContext);
     patchFactoryContextForMethodValidation(factoryContext);
@@ -43,6 +47,7 @@ class MethodValidatorImpl extends ClassV
 
   /**
    * experimental: replace the Jsr303MetaBeanFactory with a MethodValidatorMetaBeanFactory in the factoryContext.
+   * @param factoryContext
    */
   private void patchFactoryContextForMethodValidation(ApacheFactoryContext factoryContext) {
     MetaBeanFactory[] factories = ((MetaBeanManager) getMetaBeanFinder()).getBuilder().getFactories();
@@ -53,6 +58,9 @@ class MethodValidatorImpl extends ClassV
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   protected BeanDescriptorImpl createBeanDescriptor(MetaBean metaBean) {
     MethodBeanDescriptorImpl descriptor = new MethodBeanDescriptorImpl(factoryContext,
@@ -64,6 +72,7 @@ class MethodValidatorImpl extends ClassV
   }
 
   /**
+   * {@inheritDoc}
    * enhancement: method-level-validation not yet completly implemented
    * <pre>example:
    * <code>
@@ -91,6 +100,9 @@ class MethodValidatorImpl extends ClassV
         methodDescriptor.getParameterDescriptors(), parameters, groupArray);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public <T> Set<ConstraintViolation<T>> validateParameter(Class<T> clazz, Method method,
                                                            Object parameter,
                                                            int parameterIndex,
@@ -107,6 +119,9 @@ class MethodValidatorImpl extends ClassV
     return validateParameter(paramDesc, parameter, groupArray);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public <T> Set<ConstraintViolation<T>> validateParameters(Class<T> clazz,
                                                             Constructor<T> constructor,
                                                             Object[] parameters,
@@ -122,6 +137,9 @@ class MethodValidatorImpl extends ClassV
         constructorDescriptor.getParameterDescriptors(), parameters, groupArray);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   public <T> Set<ConstraintViolation<T>> validateParameter(Class<T> clazz,
                                                            Constructor<T> constructor,
                                                            Object parameter,
@@ -140,9 +158,11 @@ class MethodValidatorImpl extends ClassV
   }
 
   /**
+   * {@inheritDoc}
    * If @Valid  is placed on the method, the constraints declared on the object
    * itself are considered.
    */
+  @SuppressWarnings("unchecked")
   public <T> Set<ConstraintViolation<T>> validateReturnedValue(Class<T> clazz, Method method,
                                                                Object returnedValue,
                                                                Class<?>... groupArray) {
@@ -156,10 +176,11 @@ class MethodValidatorImpl extends ClassV
     final GroupValidationContext<ConstraintValidationListener<Object>> context =
         createContext(methodDescriptor.getMetaBean(), returnedValue, null, groupArray);
     validateReturnedValueInContext(context, methodDescriptor);
-    ConstraintValidationListener result = context.getListener();
+    ConstraintValidationListener<T> result = (ConstraintValidationListener<T>) context.getListener();
     return result.getConstaintViolations();
   }
 
+  @SuppressWarnings("unchecked")
   private <T> Set<ConstraintViolation<T>> validateParameters(MetaBean metaBean,
                                                              List<ParameterDescriptor> paramDescriptors,
                                                              Object[] parameters,
@@ -175,22 +196,23 @@ class MethodValidatorImpl extends ClassV
           context.setBean(parameters[i]);
           validateParameterInContext(context, paramDesc);
         }
-        ConstraintValidationListener result = context.getListener();
+        ConstraintValidationListener<T> result = (ConstraintValidationListener<T>) context.getListener();
         return result.getConstaintViolations();
       } catch (RuntimeException ex) {
         throw unrecoverableValidationError(ex, parameters);
       }
     } else {
-      return Collections.EMPTY_SET;
+      return Collections.<ConstraintViolation<T>> emptySet();
     }
   }
 
+  @SuppressWarnings("unchecked")
   private <T> Set<ConstraintViolation<T>> validateParameter(
       ParameterDescriptorImpl paramDesc, Object parameter, Class<?>... groupArray) {
     try {
       final GroupValidationContext<ConstraintValidationListener<Object>> context =
           createContext(paramDesc.getMetaBean(), parameter, null, groupArray);
-      final ConstraintValidationListener result = context.getListener();
+      final ConstraintValidationListener<T> result = (ConstraintValidationListener<T>) context.getListener();
       validateParameterInContext(context, paramDesc);
       return result.getConstaintViolations();
     } catch (RuntimeException ex) {
@@ -207,8 +229,8 @@ class MethodValidatorImpl extends ClassV
 
     final Groups groups = context.getGroups();
 
-    for (ConstraintDescriptor consDesc : paramDesc.getConstraintDescriptors()) {
-      ConstraintValidation validation = (ConstraintValidation) consDesc;
+    for (ConstraintDescriptor<?> consDesc : paramDesc.getConstraintDescriptors()) {
+      ConstraintValidation<?> validation = (ConstraintValidation<?>) consDesc;
       // 1. process groups
       for (Group current : groups.getGroups()) {
         context.setCurrentGroup(current);
@@ -259,8 +281,8 @@ class MethodValidatorImpl extends ClassV
 
     final Groups groups = context.getGroups();
 
-    for (ConstraintDescriptor consDesc : methodDescriptor.getConstraintDescriptors()) {
-      ConstraintValidation validation = (ConstraintValidation) consDesc;
+    for (ConstraintDescriptor<?> consDesc : methodDescriptor.getConstraintDescriptors()) {
+      ConstraintValidation<?> validation = (ConstraintValidation<?>) consDesc;
       // 1. process groups
       for (Group current : groups.getGroups()) {
         context.setCurrentGroup(current);

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorMetaBeanFactory.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorMetaBeanFactory.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorMetaBeanFactory.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/MethodValidatorMetaBeanFactory.java Fri Jul  9 16:31:15 2010
@@ -35,19 +35,30 @@ import java.lang.reflect.Method;
 import java.util.HashMap;
 
 /**
- * Description: <br/>
+ * Description: extension to validate parameters/return values of methods/constructors.<br/>
  */
 //TODO RSt - move. this is an optional module: move the whole package. core code has no dependencies on it 
 public class MethodValidatorMetaBeanFactory extends Jsr303MetaBeanFactory {
+  /**
+   * Create a new MethodValidatorMetaBeanFactory instance.
+   * @param factoryContext
+   */
   public MethodValidatorMetaBeanFactory(ApacheFactoryContext factoryContext) {
     super(factoryContext);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   protected boolean hasValidationConstraintsDefined(Method method) {
     return false;
   }
 
+  /**
+   * Finish building the specified {@link MethodBeanDescriptorImpl}.
+   * @param descriptor
+   */
   public void buildMethodDescriptor(MethodBeanDescriptorImpl descriptor) {
     try {
       buildMethodConstraints(descriptor);
@@ -138,7 +149,7 @@ public class MethodValidatorMetaBeanFact
     methodDesc.getParameterDescriptors().add(paramDesc);
   }
 
-  private void processAnnotation(Annotation annotation, ProcedureDescriptor desc,
+  private <A extends Annotation> void processAnnotation(A annotation, ProcedureDescriptor desc,
                                  AccessStrategy access, AppendValidation validations)
       throws InvocationTargetException, IllegalAccessException {
 
@@ -147,10 +158,10 @@ public class MethodValidatorMetaBeanFact
     } else {
       Constraint vcAnno = annotation.annotationType().getAnnotation(Constraint.class);
       if (vcAnno != null) {
-        Class<? extends ConstraintValidator<?, ?>>[] validatorClasses;
+        Class<? extends ConstraintValidator<A, ?>>[] validatorClasses;
         validatorClasses = findConstraintValidatorClasses(annotation, vcAnno);
         applyConstraint(annotation, validatorClasses, null,
-            ClassUtils.primitiveToWrapper((Class)access.getJavaType()), access, validations);
+            ClassUtils.primitiveToWrapper((Class<?>) access.getJavaType()), access, validations);
       } else {
         /**
          * Multi-valued constraints

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterAccess.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterAccess.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterAccess.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterAccess.java Fri Jul  9 16:31:15 2010
@@ -36,26 +36,43 @@ public class ParameterAccess extends Acc
     private Type paramType;
     private int paramIdx;
 
+    /**
+     * Create a new ParameterAccess instance.
+     * @param paramType
+     * @param paramIdx
+     */
     public ParameterAccess(Type paramType, int paramIdx ) {
         this.paramType = paramType;
         this.paramIdx = paramIdx;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Object get(Object instance) {
         throw new NotImplementedException("Obtaining a parameter value not yet implemented");
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public ElementType getElementType() {
         return ElementType.PARAMETER;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Type getJavaType() {
         return this.paramType;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String getPropertyName() {
         return "" + paramIdx;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptor.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptor.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptor.java Fri Jul  9 16:31:15 2010
@@ -30,6 +30,10 @@ public interface ParameterDescriptor ext
      */
     boolean isCascaded();
 
+    /**
+     * Get the index of the referenced parameter.
+     * @return int
+     */
     int getIndex();
 }
 

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptorImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptorImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptorImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ParameterDescriptorImpl.java Fri Jul  9 16:31:15 2010
@@ -22,33 +22,57 @@ import org.apache.bval.model.Validation;
 
 
 /**
- * Description: <br/>
+ * Description: {@link ParameterDescriptor} implementation.<br/>
  */
 public class ParameterDescriptorImpl extends ElementDescriptorImpl
       implements ParameterDescriptor {
     private boolean cascaded;
     private int index;
 
+    /**
+     * Create a new ParameterDescriptorImpl instance.
+     * @param metaBean
+     * @param validations
+     */
     public ParameterDescriptorImpl(MetaBean metaBean, Validation[] validations) {
         super(metaBean, metaBean.getClass(), validations);
     }
 
+    /**
+     * Create a new ParameterDescriptorImpl instance.
+     * @param elementClass
+     * @param validations
+     */
     public ParameterDescriptorImpl(Class<?> elementClass, Validation[] validations) {
         super(elementClass, validations);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascaded() {
         return cascaded;
     }
 
+    /**
+     * Set whether the referenced parameter descriptor should be validated.
+     * @param cascaded
+     */
     public void setCascaded(boolean cascaded) {
         this.cascaded = cascaded;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public int getIndex() {
         return index;
     }
 
+    /**
+     * Set the index of the referenced parameter.
+     * @param index
+     */
     public void setIndex(int index) {
         this.index = index;
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ProcedureDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ProcedureDescriptor.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ProcedureDescriptor.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ProcedureDescriptor.java Fri Jul  9 16:31:15 2010
@@ -22,12 +22,24 @@ import java.util.List;
 import org.apache.bval.model.MetaBean;
 
 /**
- * Description: <br/>
+ * Description: superinterface of {@link ConstructorDescriptor} and {@link MethodDescriptor}.<br/>
  */
 public interface ProcedureDescriptor {
+    /**
+     * Get the owning metabean.
+     * @return MetaBean
+     */
     MetaBean getMetaBean();
 
+    /**
+     * Set whether this procedure should be validated.
+     * @param b
+     */
     void setCascaded(boolean b);
 
+    /**
+     * Get the parameter descriptors of this procedure.
+     * @return {@link List} of {@link ParameterDescriptor}
+     */
     List<ParameterDescriptor> getParameterDescriptors();
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ReturnAccess.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ReturnAccess.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ReturnAccess.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/extensions/ReturnAccess.java Fri Jul  9 16:31:15 2010
@@ -34,25 +34,41 @@ public class ReturnAccess extends Access
 
     private Type returnType;
 
+    /**
+     * Create a new ReturnAccess instance.
+     * @param returnType
+     */
     public ReturnAccess(Type returnType) {
         this.returnType = returnType;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Object get(Object instance) {
         throw new NotImplementedException("Obtaining a method return value not yet implemented");
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public ElementType getElementType() {
         return ElementType.METHOD;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public Type getJavaType() {
         return this.returnType;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String getPropertyName() {
         return "Return value";

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Group.java Fri Jul  9 16:31:15 2010
@@ -21,34 +21,51 @@ package org.apache.bval.jsr303.groups;
 import javax.validation.groups.Default;
 
 /**
- * immutable object -
- * wrap an interface that represents a single group.
+ * Immutable object that wraps an interface representing a single group.
  */
 public class Group {
     /**
      * the Default Group
      */
     public static final Group DEFAULT = new Group(Default.class);
-    
+
     private final Class<?> group;
 
+    /**
+     * Create a new Group instance.
+     * @param group
+     */
     public Group(Class<?> group) {
         this.group = group;
     }
 
+    /**
+     * Get the actual group class.
+     * @return
+     */
     public Class<?> getGroup() {
         return group;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public String toString() {
         return "Group{" + "group=" + group + '}';
     }
 
+    /**
+     * Learn whether the group represented is the default group.
+     * @return boolean
+     */
 	public boolean isDefault() {
 		return Default.class.equals(group);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -59,6 +76,9 @@ public class Group {
         return !(group != null ? !group.equals(group1.group) : group1.group != null);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public int hashCode() {
         return (group != null ? group.hashCode() : 0);

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Groups.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Groups.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Groups.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/Groups.java Fri Jul  9 16:31:15 2010
@@ -24,7 +24,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 /**
- * defines the order to validate groups during validation.
+ * Defines the order to validate groups during validation.
  * with some inspiration from reference implementation
  *
  * @author Roman Stumm
@@ -36,20 +36,36 @@ public class Groups {
     /** The list of sequences. */
     protected List<List<Group>> sequences = new LinkedList<List<Group>>();
 
+    /**
+     * Get the Groups.
+     * @return {@link List} of {@link Group}.
+     */
     public List<Group> getGroups() {
         return groups;
     }
 
+    /**
+     * Get the Group sequences.
+     * @return {@link List} of {@link List} of {@link Group}
+     */
     public List<List<Group>> getSequences() {
         return sequences;
     }
 
+    /**
+     * Insert a {@link Group}.
+     * @param group to insert
+     */
     void insertGroup(Group group) {
         if (!groups.contains(group)) {
             groups.add(group);
         }
     }
 
+    /**
+     * Insert a sequence.
+     * @param groups {@link List} of {@link Group} to insert
+     */
     void insertSequence(List<Group> groups) {
         if (groups == null || groups.isEmpty()) {
             return;
@@ -60,6 +76,10 @@ public class Groups {
         }
     }
 
+    /**
+     * Assert that the default group can be expanded to <code>defaultGroups</code>.
+     * @param defaultGroups
+     */
     public void assertDefaultGroupSequenceIsExpandable(List<Group> defaultGroups) {
         for (List<Group> groupList : sequences) {
             int idx = groupList.indexOf(Group.DEFAULT);

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/GroupsComputer.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/GroupsComputer.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/GroupsComputer.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/groups/GroupsComputer.java Fri Jul  9 16:31:15 2010
@@ -39,6 +39,10 @@ public class GroupsComputer {
             Arrays.asList(getDefaultGroupArray()));
     }
 
+    /**
+     * Get the default group array.
+     * @return <code>{@link Default}.class</code> only
+     */
     public static Class<?>[] getDefaultGroupArray() {
         return new Class<?>[]{Default.class};
     }
@@ -47,6 +51,11 @@ public class GroupsComputer {
     private final Map<Class<?>, List<Group>> resolvedSequences =
           Collections.synchronizedMap(new HashMap<Class<?>, List<Group>>());
 
+    /**
+     * Compute groups from an array of group classes.
+     * @param groups
+     * @return {@link Groups}
+     */
     public Groups computeGroups(Class<?>[] groups) {
         if (groups == null) {
             throw new IllegalArgumentException("null passed as group");
@@ -60,6 +69,11 @@ public class GroupsComputer {
         return computeGroups(Arrays.asList(groups));
     }
 
+    /**
+     * Main compute implementation.
+     * @param groups
+     * @return {@link Groups}
+     */
     protected Groups computeGroups(Collection<Class<?>> groups) {
         if (groups == null || groups.size() == 0) {
             throw new IllegalArgumentException("At least one group has to be specified.");

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingRelevant.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingRelevant.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingRelevant.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingRelevant.java Fri Jul  9 16:31:15 2010
@@ -18,10 +18,16 @@
  */
 package org.apache.bval.jsr303.resolver;
 
+import javax.validation.TraversableResolver;
+
 /**
  * Description: indicator interface to let the implementation choose
- * whether results of traversable resolver should be cached <br/>
+ * whether results of traversable resolver should be cached.<br/>
  */
 public interface CachingRelevant {
+    /**
+     * Learn whether the results of the {@link TraversableResolver} should be cached.
+     * @return boolean
+     */
     boolean needsCaching();
 }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingTraversableResolver.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingTraversableResolver.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingTraversableResolver.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/CachingTraversableResolver.java Fri Jul  9 16:31:15 2010
@@ -36,17 +36,31 @@ public class CachingTraversableResolver 
     private TraversableResolver delegate;
     private Map<CacheEntry, CacheEntry> cache = new HashMap<CacheEntry, CacheEntry>();
 
-    /** @return true when a CachingTraversableResolver is to be used during validation */
+    /**
+     * Convenience method to check whether caching is necessary on a given {@link TraversableResolver}.
+     * @param resolver to check
+     * @return true when a CachingTraversableResolver is to be used during validation
+     */
     public static boolean needsCaching(TraversableResolver resolver) {
         // caching, if we do not know exactly
         return !(resolver instanceof CachingRelevant) ||
               ((CachingRelevant) resolver).needsCaching();
     }
 
+    /**
+     * Create a new CachingTraversableResolver instance.
+     * @param delegate
+     */
     public CachingTraversableResolver(TraversableResolver delegate) {
         this.delegate = delegate;
     }
 
+    /**
+     * If necessary, return a caching wrapper for the specified {@link TraversableResolver}.
+     * @param traversableResolver
+     * @return {@link TraversableResolver}
+     * @see #needsCaching(TraversableResolver)
+     */
     public static TraversableResolver cacheFor(TraversableResolver traversableResolver) {
         if (needsCaching(traversableResolver)) {
             return new CachingTraversableResolver(traversableResolver);
@@ -55,6 +69,9 @@ public class CachingTraversableResolver 
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
                                Class<?> rootBeanType, Path pathToTraversableObject,
                                ElementType elementType) {
@@ -73,6 +90,9 @@ public class CachingTraversableResolver 
         return cachedLH.reachable;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascadable(Object traversableObject, Path.Node traversableProperty,
                                 Class<?> rootBeanType, Path pathToTraversableObject,
                                 ElementType elementType) {
@@ -91,10 +111,16 @@ public class CachingTraversableResolver 
         return cachedLH.cascadable;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean needsCaching() {
         return false;  // I am the cache. Do not need cache for cache
     }
 
+    /**
+     * Entry in the cache.
+     */
     private static class CacheEntry {
         private final Object object;
         private final Path.Node node;
@@ -106,7 +132,14 @@ public class CachingTraversableResolver 
         private Boolean reachable;
         private Boolean cascadable;
 
-
+        /**
+         * Create a new CacheEntry instance.
+         * @param traversableObject
+         * @param traversableProperty
+         * @param rootBeanType
+         * @param pathToTraversableObject
+         * @param elementType
+         */
         private CacheEntry(Object traversableObject, Path.Node traversableProperty,
                            Class<?> rootBeanType, Path pathToTraversableObject,
                            ElementType elementType) {
@@ -118,6 +151,9 @@ public class CachingTraversableResolver 
             this.hashCode = buildHashCode();
         }
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public boolean equals(Object o) {
             if (this == o) {
@@ -136,6 +172,9 @@ public class CachingTraversableResolver 
 
         }
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public int hashCode() {
             return hashCode;

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/DefaultTraversableResolver.java Fri Jul  9 16:31:15 2010
@@ -41,11 +41,16 @@ public class DefaultTraversableResolver 
 
     private TraversableResolver jpaTR;
 
-
+    /**
+     * Create a new DefaultTraversableResolver instance.
+     */
     public DefaultTraversableResolver() {
         initJpa();
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
                                Class<?> rootBeanType, Path pathToTraversableObject,
                                ElementType elementType) {
@@ -53,6 +58,9 @@ public class DefaultTraversableResolver 
               rootBeanType, pathToTraversableObject, elementType);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascadable(Object traversableObject, Path.Node traversableProperty,
                                 Class<?> rootBeanType, Path pathToTraversableObject,
                                 ElementType elementType) {
@@ -61,6 +69,7 @@ public class DefaultTraversableResolver 
     }
 
     /** Tries to load detect and load JPA. */
+    @SuppressWarnings("unchecked")
     private void initJpa() {
         try {
             ClassUtils.getClass(PERSISTENCE_UTIL_CLASSNAME);
@@ -88,6 +97,9 @@ public class DefaultTraversableResolver 
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean needsCaching() {
         return jpaTR != null && CachingTraversableResolver.needsCaching(jpaTR);
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/JPATraversableResolver.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/JPATraversableResolver.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/JPATraversableResolver.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/JPATraversableResolver.java Fri Jul  9 16:31:15 2010
@@ -25,6 +25,9 @@ import java.lang.annotation.ElementType;
 /** @see javax.validation.TraversableResolver */
 public class JPATraversableResolver implements TraversableResolver, CachingRelevant {
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
                                Class<?> rootBeanType, Path pathToTraversableObject,
                                ElementType elementType) {
@@ -32,12 +35,18 @@ public class JPATraversableResolver impl
               .isLoaded(traversableObject, traversableProperty.getName());
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isCascadable(Object traversableObject, Path.Node traversableProperty,
                                 Class<?> rootBeanType, Path pathToTraversableObject,
                                 ElementType elementType) {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean needsCaching() {
         return true; // yes
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/SimpleTraversableResolver.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/SimpleTraversableResolver.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/SimpleTraversableResolver.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/resolver/SimpleTraversableResolver.java Fri Jul  9 16:31:15 2010
@@ -23,24 +23,33 @@ import javax.validation.TraversableResol
 import java.lang.annotation.ElementType;
 
 /**
- * Description: traversable resolver that does always resolve<br/>
+ * Description: traversable resolver that does always resolve.<br/>
  */
 public class SimpleTraversableResolver implements TraversableResolver, CachingRelevant {
-    /** @return true */
+    /**
+     * {@inheritDoc}
+     *  @return <code>true</code>
+     */
     public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
                                Class<?> rootBeanType, Path pathToTraversableObject,
                                java.lang.annotation.ElementType elementType) {
         return true;
     }
 
-    /** @return true */
-
+    /**
+     * {@inheritDoc}
+     * @return <code>true</code>
+     */
     public boolean isCascadable(Object traversableObject, Path.Node traversableProperty,
                                 Class<?> rootBeanType, Path pathToTraversableObject,
                                 ElementType elementType) {
         return true;
     }
 
+    /**
+     * {@inheritDoc}
+     * @return <code>false</code>
+     */
     public boolean needsCaching() {
         return false;  // no
     }

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/ClassHelper.java Fri Jul  9 16:31:15 2010
@@ -24,7 +24,7 @@ import java.util.Arrays;
 import java.util.List;
 
 /**
- * Common operations on classes that do not requiere an {@link AccessController}.
+ * Common operations on classes that do not require an {@link AccessController}.
  * 
  * @author Carlos Vara
  */
@@ -51,8 +51,6 @@ public class ClassHelper {
             return;
         }
         allClasses.add(clazz);
-        // List<Class<?>> subClasses = new ArrayList<Class<?>>(Arrays.asList(clazz.getInterfaces()));
-        // List<Class<?>> subClasses = new List<Class<?>>(Arrays.asList(clazz.getInterfaces()));
         List<Class<?>> subClasses = new ArrayList(Arrays.asList(clazz.getInterfaces()));
         subClasses.add(0, clazz.getSuperclass());
         for ( Class<?> subClass : subClasses ) {

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/EnumerationConverter.java Fri Jul  9 16:31:15 2010
@@ -20,8 +20,6 @@ package org.apache.bval.jsr303.util;
 
 import org.apache.commons.beanutils.Converter;
 
-//import com.thoughtworks.xstream.converters.ConversionException;
-
 /**
  * A {@code org.apache.commons.beanutils.Converter} implementation to handle
  * Enumeration type.

Modified: incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java?rev=962601&r1=962600&r2=962601&view=diff
==============================================================================
--- incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java (original)
+++ incubator/bval/trunk/bval-jsr303/src/main/java/org/apache/bval/jsr303/util/NodeBuilderCustomizableContextImpl.java Fri Jul  9 16:31:15 2010
@@ -24,7 +24,7 @@ import javax.validation.ConstraintValida
 import org.apache.bval.jsr303.ConstraintValidatorContextImpl;
 
 /**
- * Description: <br/>
+ * Description: implementation of {@link NodeBuilderCustomizableContext}.<br/>
  */
 final class NodeBuilderCustomizableContextImpl
       implements ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext {
@@ -35,6 +35,13 @@ final class NodeBuilderCustomizableConte
     // The actual incorporation in the path will take place when the definition of the current leaf node is complete
     private String lastNodeName; // Not final as it can be re-used
 
+    /**
+     * Create a new NodeBuilderCustomizableContextImpl instance.
+     * @param contextImpl
+     * @param template
+     * @param path
+     * @param name
+     */
     NodeBuilderCustomizableContextImpl(ConstraintValidatorContextImpl contextImpl, String template,
                               PathImpl path, String name) {
         parent = contextImpl;
@@ -43,12 +50,18 @@ final class NodeBuilderCustomizableConte
         lastNodeName = name;
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder inIterable() {
         // Modifies the "previous" node in the path
         this.propertyPath.getLeafNode().setInIterable( true );
         return new NodeContextBuilderImpl(parent, messageTemplate, propertyPath, lastNodeName);
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext addNode(
           String name) {
         addLastNodeIfNeeded();
@@ -56,6 +69,9 @@ final class NodeBuilderCustomizableConte
         return this; // Re-use this instance
     }
 
+    /**
+     * {@inheritDoc}
+     */
     public ConstraintValidatorContext addConstraintViolation() {
         addLastNodeIfNeeded();
         parent.addError(messageTemplate, propertyPath);



Mime
View raw message