From 198346fc0d5eabcd1d988a592a814c0aaf256650 Mon Sep 17 00:00:00 2001 From: Emerson Oliveira Date: Tue, 6 Aug 2013 13:21:11 -0300 Subject: [PATCH] Adição de javadoc na classe br.gov.frameworkdemoiselle.util.Exceptions --- impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Exceptions.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+), 0 deletions(-) diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Exceptions.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Exceptions.java index d6d261e..bdd175f 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Exceptions.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/util/Exceptions.java @@ -38,15 +38,39 @@ package br.gov.frameworkdemoiselle.util; import br.gov.frameworkdemoiselle.exception.ApplicationException; +/** + *Class that offer tow methods that can help with manipulation of throwable exceptions. + * + * @author SERPRO + */ public final class Exceptions { + /** + * Constructor without parameters. + */ private Exceptions() { } + /** + * Informs if a Throwable class is annotated with @ApplicationException or not. + * + * @param throwable + * a throwable object. + * + * @return a boolean, true if thowable is annotated with @ApplicationException, and false otherwise. + */ public static boolean isApplicationException(final Throwable throwable) { return throwable != null && throwable.getClass().isAnnotationPresent(ApplicationException.class); } + /** + * Receives as parameter any kind of Throwable objects, and throws a RuntimeException instead. + * + * @param throwable + * a throwable object. + * + * @throws RuntimeException throws this kind of exception every time that is called. + */ public static void handleToRuntimeException(final Throwable throwable) throws RuntimeException { if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; -- libgit2 0.21.2