incubator-bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r981307 - /incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java
Date Sun, 01 Aug 2010 20:05:24 GMT
Author: simonetripodi
Date: Sun Aug  1 20:05:24 2010
New Revision: 981307

URL: http://svn.apache.org/viewvc?rev=981307&view=rev
Log:
fixed license header
minor format
added missing javadoc

Modified:
    incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java

Modified: incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java?rev=981307&r1=981306&r2=981307&view=diff
==============================================================================
--- incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java
(original)
+++ incubator/bval/trunk/bval-guice/src/main/java/org/apache/bval/guice/ValidateMethodInterceptor.java
Sun Aug  1 20:05:24 2010
@@ -1,17 +1,18 @@
 /*
- *    Copyright 2010 The gmodules Team
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 package org.apache.bval.guice;
 
@@ -75,9 +76,10 @@ public final class ValidateMethodInterce
 
         if (!constraintViolations.isEmpty()) {
             throw getException(new ConstraintViolationException("Validation error when calling
method '"
-                    + method
-                    + "' with arguments "
-                    + Arrays.deepToString(arguments), constraintViolations), validate.rethrowExceptionsAs());
+                        + method
+                        + "' with arguments "
+                        + Arrays.deepToString(arguments), constraintViolations),
+                    validate.rethrowExceptionsAs());
         }
 
         Object returnedValue = invocation.proceed();
@@ -95,6 +97,14 @@ public final class ValidateMethodInterce
         return returnedValue;
     }
 
+    /**
+     * Define the {@link Throwable} has to be thrown when a validation error
+     * occurs and the user defined the custom error wrapper.
+     *
+     * @param exception the occurred validation error.
+     * @param exceptionWrapperClass the user defined custom error wrapper.
+     * @return the {@link Throwable} has o be thrown.
+     */
     private static Throwable getException(ConstraintViolationException exception,
             Class<? extends Throwable> exceptionWrapperClass) {
         // check the thrown exception is of same re-throw type



Mime
View raw message