incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r993587 - /incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java
Date Wed, 08 Sep 2010 02:36:47 GMT
Author: mbenson
Date: Wed Sep  8 02:36:47 2010
New Revision: 993587

URL: http://svn.apache.org/viewvc?rev=993587&view=rev
Log:
format; organize imports

Modified:
    incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java

Modified: incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java?rev=993587&r1=993586&r2=993587&view=diff
==============================================================================
--- incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java
(original)
+++ incubator/bval/sandbox/lang3-work/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/AnnotationProxyBuilder.java
Wed Sep  8 02:36:47 2010
@@ -16,11 +16,6 @@
  */
 package org.apache.bval.jsr303.xml;
 
-
-import org.apache.bval.jsr303.util.SecureActions;
-
-import javax.validation.Payload;
-import javax.validation.ValidationException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
@@ -29,13 +24,20 @@ import java.lang.reflect.Proxy;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.validation.Payload;
+import javax.validation.ValidationException;
+
+import org.apache.bval.jsr303.util.SecureActions;
+
 /**
- * Description: Holds the information and creates an annotation proxy
- * during xml parsing of validation mapping constraints. <br/>
+ * Description: Holds the information and creates an annotation proxy during xml
+ * parsing of validation mapping constraints. <br/>
  */
-//TODO move this guy up to org.apache.bval.jsr303 or org.apache.bval.jsr303.model
+// TODO move this guy up to org.apache.bval.jsr303 or
+// org.apache.bval.jsr303.model
 final public class AnnotationProxyBuilder<A extends Annotation> {
-    //TODO extract these to some neutral location; see AnnotationConstraintBuilder
+    // TODO extract these to some neutral location; see
+    // AnnotationConstraintBuilder
     private static final String ANNOTATION_PAYLOAD = "payload";
     private static final String ANNOTATION_GROUPS = "groups";
     private static final String ANNOTATION_MESSAGE = "message";
@@ -46,6 +48,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create a new AnnotationProxyBuilder instance.
+     * 
      * @param annotationType
      */
     public AnnotationProxyBuilder(Class<A> annotationType) {
@@ -54,6 +57,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create a new AnnotationProxyBuilder instance.
+     * 
      * @param annotationType
      * @param elements
      */
@@ -65,8 +69,9 @@ final public class AnnotationProxyBuilde
     }
 
     /**
-     * Create a builder initially configured to create an annotation equivalent to <code>annot</code>.
-     *
+     * Create a builder initially configured to create an annotation equivalent
+     * to <code>annot</code>.
+     * 
      * @param annot
      *            Annotation to be replicated.
      */
@@ -75,8 +80,8 @@ final public class AnnotationProxyBuilde
         this((Class<A>) annot.annotationType());
         // Obtain the "elements" of the annotation
         Method[] methods = SecureActions.getDeclaredMethods(annot.annotationType());
-        for ( Method m : methods ) {
-            if ( !m.isAccessible() ) {
+        for (Method m : methods) {
+            if (!m.isAccessible()) {
                 m.setAccessible(true);
             }
             try {
@@ -95,6 +100,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Add an element to the configuration.
+     * 
      * @param elementName
      * @param value
      */
@@ -104,6 +110,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the specified element value from the current configuration.
+     * 
      * @param elementName
      * @return Object value
      */
@@ -113,8 +120,10 @@ final public class AnnotationProxyBuilde
 
     /**
      * Learn whether a given element has been configured.
+     * 
      * @param elementName
-     * @return <code>true</code> if an <code>elementName</code> element
is found on this annotation
+     * @return <code>true</code> if an <code>elementName</code> element
is found
+     *         on this annotation
      */
     public boolean contains(String elementName) {
         return elements.containsKey(elementName);
@@ -122,6 +131,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the number of configured elements.
+     * 
      * @return int
      */
     public int size() {
@@ -130,6 +140,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Get the configured Annotation type.
+     * 
      * @return Class<A>
      */
     public Class<A> getType() {
@@ -138,6 +149,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "message" element.
+     * 
      * @param message
      */
     public void setMessage(String message) {
@@ -146,6 +158,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "groups" element.
+     * 
      * @param groups
      */
     public void setGroups(Class<?>[] groups) {
@@ -154,6 +167,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Configure the well-known JSR303 "payload" element.
+     * 
      * @param payload
      */
     public void setPayload(Class<? extends Payload>[] payload) {
@@ -162,6 +176,7 @@ final public class AnnotationProxyBuilde
 
     /**
      * Create the annotation represented by this builder.
+     * 
      * @return {@link Annotation}
      */
     @SuppressWarnings("unchecked")
@@ -170,13 +185,11 @@ final public class AnnotationProxyBuilde
         Class<A> proxyClass = (Class<A>) Proxy.getProxyClass(classLoader, getType());
         InvocationHandler handler = new AnnotationProxy(this);
         try {
-            return SecureActions.getConstructor(proxyClass, InvocationHandler.class)
-                  .newInstance(handler);
+            return SecureActions.getConstructor(proxyClass, InvocationHandler.class).newInstance(handler);
         } catch (ValidationException e) {
             throw e;
         } catch (Exception e) {
-            throw new ValidationException(
-                  "Unable to create annotation for configured constraint", e);
+            throw new ValidationException("Unable to create annotation for configured constraint",
e);
         }
     }
 }



Mime
View raw message