From 38e4750e43da8a3946e8cc8f46e7438a8b8cf8e2 Mon Sep 17 00:00:00 2001 From: Clovis Lemes Ferreira Junior Date: Fri, 30 Sep 2016 14:45:04 -0300 Subject: [PATCH] Remove javadocs --- demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigType.java | 18 ------------------ demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationException.java | 21 +-------------------- demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationInterceptor.java | 6 ------ demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationLoader.java | 40 +--------------------------------------- demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/annotation/Configuration.java | 47 ----------------------------------------------- demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/extractor/ConfigurationValueExtractor.java | 41 ----------------------------------------- 6 files changed, 2 insertions(+), 171 deletions(-) diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigType.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigType.java index fad93e3..241833a 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigType.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigType.java @@ -1,25 +1,7 @@ package org.demoiselle.jee.configuration; -/** - * Defines configuration types to be loaded. - * - * @author SERPRO - */ public enum ConfigType { - - /** - * Configuration loaded on {@link System#getProperties()} or {@link System#getenv()}. - */ SYSTEM, - - /** - * Configuration loaded on XML resources. - */ XML, - - /** - * Configuration loaded on properties resources. - */ PROPERTIES - } diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationException.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationException.java index 112e4bb..47d68be 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationException.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationException.java @@ -2,33 +2,14 @@ package org.demoiselle.jee.configuration; import org.demoiselle.jee.core.exception.DemoiselleException; -/** - * Exception class intended to be used by configuration components. - * - * @author SERPRO - */ public class ConfigurationException extends DemoiselleException{ private static final long serialVersionUID = 1L; - /** - * Constructor with message. - * - * @param message - * exception message - */ public ConfigurationException(String message) { super(message); } - - /** - * Constructor with message and cause. - * - * @param message - * exception message - * @param cause - * exception cause - */ + public ConfigurationException(String message, Throwable cause) { super(message, cause); } diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationInterceptor.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationInterceptor.java index c8046f9..bda9345 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationInterceptor.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationInterceptor.java @@ -9,12 +9,6 @@ import javax.interceptor.InvocationContext; import org.demoiselle.jee.configuration.annotation.Configuration; -/** - *

- * Interceptor class that loads the values of configuration files - * into it's mapped class. - *

- */ @Dependent @Configuration @Interceptor diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationLoader.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationLoader.java index f560c03..bef93f6 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationLoader.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/ConfigurationLoader.java @@ -43,13 +43,6 @@ import org.demoiselle.jee.core.annotation.Ignore; import org.demoiselle.jee.core.annotation.Name; import org.demoiselle.jee.core.annotation.Priority; -/** - * This component loads a config class annotated with {@link org.demoiselle.jee.configuration.annotation.configuration.Configuration} - * by filling its attributes with {@link org.demoiselle.jsf.util.Parameter} - * according to a {@link org.demoiselle.configuration.ConfigType}. - * - * @author SERPRO - */ @ApplicationScoped public class ConfigurationLoader implements Serializable { @@ -316,14 +309,7 @@ public class ConfigurationLoader implements Serializable { throw new ConfigurationException(message.toString(), new ConstraintViolationException(violations)); } } - - - - /** - * @param type Base type to look for fields - * @return All non static fields from a certain type, including fields declared in superclasses of this type. - */ public List getNonStaticFields(Class type) { List fields = new ArrayList(); @@ -338,11 +324,6 @@ public class ConfigurationLoader implements Serializable { return fields; } - /** - * @param type Base type to look for fields - * @return All non static fields from a certain type. Inherited fields are not returned, so if you need to get - * inherited fields you must iterate over this type's hierarchy. - */ public Field[] getNonStaticDeclaredFields(Class type) { List fields = new ArrayList(); @@ -357,23 +338,11 @@ public class ConfigurationLoader implements Serializable { return fields.toArray(new Field[0]); } - /** - * Return an URL to access a resource available to the active classloader for the calling thread. - * - * @param resource String representation of the location of the resource on the classpath - * @return The {@link URL} for the resource - */ public URL getResourceAsURL(final String resource) { ClassLoader classLoader = getClassLoaderForResource(resource); return classLoader != null ? classLoader.getResource(resource) : null; } - - /** - * Obtains the {@link ClassLoader} for the given resource. - * - * @param resource String representation of the fully qualified path to the resource on the classpath - * @return {@link ClassLoader} ClassLoader for the given resource. - */ + public ClassLoader getClassLoaderForResource(final String resource) { final String stripped = resource.charAt(0) == '/' ? resource.substring(1) : resource; @@ -413,13 +382,6 @@ public class ConfigurationLoader implements Serializable { return result; } - /** - * Sets a value in a field. - * - * @param field field to be setted. - * @param object object that contains the field. - * @param value value to be setted in the field. - */ public void setFieldValue(Field field, Object object, Object value) { try { boolean acessible = field.isAccessible(); diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/annotation/Configuration.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/annotation/Configuration.java index 3c519bf..c1025ad 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/annotation/Configuration.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/annotation/Configuration.java @@ -14,24 +14,6 @@ import java.lang.annotation.Target; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; -/** - *

- * Identifies a configuration class, that is, a structure reserved to store configuration values retrieved from a - * given resource file or system variables. - *

- *

- * Configuration resources are application scoped, meaning only one instance can ever exist in - * a running application. For that reason usually configuration fields are immutable, to avoid - * changes made in one context affecting other contexts in a running application. - *

- *

A Configuration is:

- *
    - *
  • defined when annotated with {@code @Configuration}
  • - *
  • automatically injected whenever {@code @Inject} is used
  • - *
- * - * @author SERPRO - */ @ApplicationScoped @Named @InterceptorBinding @@ -40,43 +22,14 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @Retention(RUNTIME) public @interface Configuration { - /** - * Define the default prefix. - */ String DEFAULT_PREFIX = "demoiselle"; - /** - * Define the default resource. - */ String DEFAULT_RESOURCE = "demoiselle"; - /** - * Defines the resource type to be used: a properties file, an XML file, or system variables. - * If not specified, a properties resource file is to be considered. - * - * @return ConfigType Type of configuration resource file to look for - */ @Nonbinding ConfigType type() default ConfigType.PROPERTIES; - /** - * Defines an optional prefix to be used on every parameter key. - * For instance, if prefix is set to "demoiselle.pagination" and an attribute named - * defaultPageSize is found in the class, the corresponding key - * demoiselle.pagination.defaultPageSize is expected to be read in the resource file. - * - * @return String prefix common to all attributes to be read by the configuration class - */ @Nonbinding String prefix() default DEFAULT_PREFIX; - /** - * Defines the resource file name to be read by this configuration class. There is no need to specify file extension - * in the case of properties or XML resources. - * For instance, when resource is set to "bookmark" and the type set to properties, a corresponding - * file named bookmark.properties is considered. - * If not specified, the default configuration file demoiselle.properties is used instead. - * - * @return String Name of the resource file to look for (minus file extension) - */ @Nonbinding String resource() default DEFAULT_RESOURCE; } diff --git a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/extractor/ConfigurationValueExtractor.java b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/extractor/ConfigurationValueExtractor.java index 6f974af..67f9f16 100644 --- a/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/extractor/ConfigurationValueExtractor.java +++ b/demoiselle-configuration/src/main/java/org/demoiselle/jee/configuration/extractor/ConfigurationValueExtractor.java @@ -4,48 +4,7 @@ import java.lang.reflect.Field; import org.apache.commons.configuration2.Configuration; -/** - *

- * Interface that defines how to convert values extracted from configuration - * files to fields in a class annotated with {@link Configuration}. - *

- * - *

- * Primitive types like int and float, their wrapper - * counterparts like {@link Integer} and {@link Float} and the {@link String} class - * can already be converted by the framework, this interface is reserved for specialized - * classes. - *

- * - * @author SERPRO - */ public interface ConfigurationValueExtractor { - - /** - * Method that must appropriately extract the value from a property file and set this value to a - * field in a configuration class. - * - * @param prefix - * optional parte of property name that must be concatenated with key to form the whole - * property name. - * @param key - * key of the property. - * @param field - * configuration field to be setted. - * @param configuration - * a configuration object. - * @return current value of this property - * @throws Exception if the value can't be extracted from the property file - */ Object getValue(String prefix, String key, Field field, Configuration configuration) throws Exception; - - /** - * Checks if the extractor class is appropriate to extract values to the type of deffined by parameter - * field. - * - * @param field - * field to be checked. - * @return true if this extractor can convert this field into the extractor's final type - */ boolean isSupported(Field field); } -- libgit2 0.21.2