You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@onami.apache.org by si...@apache.org on 2013/02/02 20:50:46 UTC
svn commit: r1441796 -
/incubator/onami/sandbox/validation/src/site/apt/index.apt.vm
Author: simonetripodi
Date: Sat Feb 2 19:50:45 2013
New Revision: 1441796
URL: http://svn.apache.org/viewvc?rev=1441796&view=rev
Log:
[ONAMI-74] #comment added missing documentation about @Validate#rethrowExceptionsAs() and @Validate#exceptionMessage() #resolve
Modified:
incubator/onami/sandbox/validation/src/site/apt/index.apt.vm
Modified: incubator/onami/sandbox/validation/src/site/apt/index.apt.vm
URL: http://svn.apache.org/viewvc/incubator/onami/sandbox/validation/src/site/apt/index.apt.vm?rev=1441796&r1=1441795&r2=1441796&view=diff
==============================================================================
--- incubator/onami/sandbox/validation/src/site/apt/index.apt.vm (original)
+++ incubator/onami/sandbox/validation/src/site/apt/index.apt.vm Sat Feb 2 19:50:45 2013
@@ -168,3 +168,15 @@ public class MyService
* <<<groups>>> Class array, <<<{}>>> by default, that specifies the groups to be validated;
* <<<validateReturnedValue>>> flag, <<<false>>> by default, indicating whether the method's return value should be validated.
+
+* Re-throwing exceptions
+
+ <<<...@Validate>>> annotations supports special configuration settings to re-throw validations error in a custom exception.
+
+ When specifying <<<rethrowExceptionsAs>>> parameter, it is required that the target exception type has the constructor
+ with <<<Throwable>>> single argument; when specifying both <<<rethrowExceptionsAs>>> and <<<exceptionMessage>>>
+ parameters, it is required that the target exception type has the constructor with <<<String, Throwable>>> arguments;
+ specifying the <<<exceptionMessage>>> parameter only, doesn't have any effect.
+
+ <<<exceptionMessage>>> supports <<<java.util.Formatter>>> place holders, intercepted method arguments will be used as
+ message format arguments.