This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-config. See http://git.nuiton.org/nuiton-config.git commit e570dce04e06cd90bb7d092cdd1324b45616e8c2 Author: Tony CHEMIT <chemit@codelutin.com> Date: Mon Jan 18 09:33:49 2016 +0100 Make javadoc ok with jdk8 (Fixes #3869) --- .../java/org/nuiton/config/ApplicationConfig.java | 138 +++++++++++---------- .../org/nuiton/config/ApplicationConfigHelper.java | 4 +- .../nuiton/config/ApplicationConfigProvider.java | 8 +- .../config/ApplicationConfigSaveException.java | 2 +- .../nuiton/config/ArgumentsParserException.java | 2 +- .../java/org/nuiton/config/ConfigActionDef.java | 6 +- .../java/org/nuiton/config/ConfigOptionDef.java | 8 +- .../org/nuiton/config/SubApplicationConfig.java | 10 +- .../org/nuiton/config/ApplicationConfigTest.java | 6 +- 9 files changed, 93 insertions(+), 91 deletions(-) diff --git a/src/main/java/org/nuiton/config/ApplicationConfig.java b/src/main/java/org/nuiton/config/ApplicationConfig.java index f73580c..0589815 100644 --- a/src/main/java/org/nuiton/config/ApplicationConfig.java +++ b/src/main/java/org/nuiton/config/ApplicationConfig.java @@ -77,7 +77,7 @@ import java.util.Set; /** * Application configuration. - * <p/> + * * <h3>A finir...</h3> * <ul> * <li>Ajout d'annotations sur les methodes @@ -93,11 +93,11 @@ import java.util.Set; * Il est simple de le faire a l'execution mais c trop tard :( * <li>Ajouter de la documentation pour {@link #getOptionAsList(String)} * </ul> - * <p/> + * * <h3>Bonnes pratiques</h3> - * <p/> + * * Vous devez créer une factory pour créer les instances d'{@link ApplicationConfig} qui contiendra par exemple une méthode : - * <p/> + * * <pre> * * public static ApplicationConfig getConfig( @@ -118,21 +118,21 @@ import java.util.Set; * } * * </pre> - * <p/> + * * <ul> * <li>MyAppConfigOption doit étendre {@link ConfigOptionDef} et décrir la configuration de l'application. * <li>MyAppConfigAction doit étendre {@link ConfigActionDef} et décrir la liste des options * et de leur alias disponible pour l'application. * </ul> - * <p/> + * * <h3>Lecture des fichiers de configuration</h3> - * <p/> + * * La lecture des fichiers de configuration se fait durant l'appel de la methode * {@link #parse(String...)} en utilisant la valeur de qui doit être définit * dans les options avec pour clef {@link ApplicationConfig#CONFIG_FILE_NAME} pour * trouver les fichiers (voir Les options de configuration pour l'ordre de * chargement des fichiers) - * <p/> + * * <h3>La sauvegarde</h3> * La sauvegarde des options se fait via une des trois methodes disponibles : * <ul> @@ -140,14 +140,14 @@ import java.util.Set; * <li> {@link #saveForSystem(String...)} sauvegarde les donnees dans /etc * <li> {@link #saveForUser(String...)} sauvegarde les donnees dans $HOME * </ul> - * <p/> + * * Lors de l'utilisation de la methode {@link #saveForSystem(String...)} ou * {@link #saveForUser(String...)} seules les options lues dans un fichier ou modifiées par * programmation ({@link #setOption(String, String)} seront sauvegardées. Par exemple les * options passees sur la ligne de commande ne seront pas sauvees. - * <p/> + * * <h3>Les options de configuration</h3> - * <p/> + * * Cette classe permet de lire les fichiers de configuration, utiliser les * variable d'environnement et de parser la ligne de commande. L'ordre de prise * en compte des informations trouvées est le suivant (le premier le plus @@ -163,14 +163,14 @@ import java.util.Set; * <li>fichier de configuration trouve dans le classpath: $CLASSPATH/filename</li> * <li>options ajoutees par programmation: {@link #defaults}.put(key, value)</li> * </ul> - * <p/> - * <p/> + * + * * Les options sur la ligne de commande sont de la forme: * <pre> * --option key value * --monOption key value1 value2 * </pre> - * <p/> + * * <ul> * <li>--option key value: est la syntaxe par defaut * <li>--monOption key value1 value2: est la syntaxe si vous avez ajouter une @@ -179,15 +179,15 @@ import java.util.Set; * arguments que vous souhaitez du moment qu'ils soient convertibles de la * representation String vers le type que vous avez mis. * </ul> - * <p/> + * * <h3>Les actions</h3> - * <p/> + * * Les actions ne peuvent etre que sur la ligne de commande. Elles sont de la * forme: * <pre> * --le.package.LaClass#laMethode arg1 arg2 arg3 ... argN * </pre> - * <p/> + * * Une action est donc defini par le chemin complet vers la methode qui traitera * l'action. Cette methode peut-etre une methode static ou non. Si la methode * n'est pas static lors de l'instanciation de l'objet on essaie de passer en @@ -198,17 +198,17 @@ import java.util.Set; * utilise (il doit etre accessible). Toutes methodes d'actions faisant * parties d'un meme objet utiliseront la meme instance de cette objet lors * de leur execution. - * <p/> + * * Si la methode utilise les arguments variants alors tous les arguments * jusqu'au prochain -- ou la fin de la ligne de commande sont utilises. Sinon * Le nombre exact d'argument necessaire a la methode sont utilises. - * <p/> + * * Les arguments sont automatiquement converti dans le bon type reclame par la * methode. - * <p/> + * * Si l'on veut des arguments optionnels le seul moyen actuellement est * d'utiliser une methode avec des arguments variants - * <p/> + * * Les actions ne sont pas execute mais seulement parsees. Pour les executer * il faut utiliser la méthode {@link #doAction(int)} qui prend en argument un numero * de 'step' ou {@link #doAllAction()} qui fait les actions dans l'ordre de leur step. @@ -224,7 +224,7 @@ import java.util.Set; * </pre> * dans cette exemple on fait un traitement entre l'execution des actions * de niveau 0 et les actions de niveau 1. - * <p/> + * * <h3>Les arguments non parsées</h3> * Tout ce qui n'est pas option ou action est considere comme non parse et peut * etre recupere par la methode {@link #getUnparsed}. Si l'on souhaite forcer @@ -236,7 +236,7 @@ import java.util.Set; * Dans cet exemple seule la premiere option sera considere comme une option. * On retrouvera dans {@code unparsed}: "mon arg", "--option", "k2", "v2", "--", * "autre" - * <p/> + * * <h3>Les alias</h3> * On voit qu'aussi bien pour les actions que pour les options, le nom de la * methode doit etre utilise. Pour eviter ceci il est possible de definir @@ -259,7 +259,7 @@ import java.util.Set; * attend encore un argment de type File. Enfin dans le troisieme exemple * on simplifie la syntaxe d'une action et on force le premier argument de * l'action a etre "import". - * <p/> + * * <h3>Conversion de type</h3> * Pour la conversion de type nous utilisons common-beans. Les types supportes * sont: @@ -275,14 +275,14 @@ import java.util.Set; * <li> les tableaux d'un type primitif ou {@link String}. Chaque element doit * etre separe par une virgule. * </ul> - * <p/> + * * Pour suporter d'autre type, il vous suffit d'enregistrer de nouveau * converter dans commons-beans. - * <p/> + * * <h3>Les substitutions de variable</h3> * {@link ApplicationConfig} supporte les substition de variables de la forme * <tt>${xxx}</tt> où {@code xxx} est une autre variable de la configuration. - * <p/> + * * Exemple (dans un fichier de configuration): * <pre> * firstname = John @@ -291,8 +291,8 @@ import java.util.Set; * </pre> * <tt>getOption("fullname")</tt> retournera <tt>"John Doe"</tt>. * - * @author Benjamin Poussin <poussin@codelutin.com> - * @author tchemit <chemit@codelutin.com> + * @author Benjamin Poussin - poussin@codelutin.com + * @author Tony Chemit - chemit@codelutin.com * @since 0.30 */ public class ApplicationConfig { @@ -320,7 +320,7 @@ public class ApplicationConfig { /** * Configuration directory where config path in located. - * <p/> + * * Use default system configuration if nothing is defined: * <ul> * <li>Linux : /etc/xxx.properties @@ -416,10 +416,10 @@ public class ApplicationConfig { /** * Internal state to manage with masse operations on option and control * listeners. - * <p/> + * * for example, if you want to save options, using javaBeans technology, * can add a listener to save each time the property is modified. - * <p/> + * * Says now you have an algorithm to set new values in configuration using * setters but you do NOt want to save each time, add in your saving action * a test to detect if model is adjusting. @@ -437,7 +437,7 @@ public class ApplicationConfig { /** * Init ApplicationConfig with current simple class name as config file. - * <p/> + * * Also init converters. * * @see ConverterUtil#initConverters() @@ -458,7 +458,7 @@ public class ApplicationConfig { /** * Init ApplicationConfig with current simple class name as config file * and use Properties parameter as defaults - * <p/> + * * Also init converters. * * @param defaults properties @@ -731,17 +731,17 @@ public class ApplicationConfig { /** * Clean the user configuration file (The one in user home) and save it * in user config file. - * <p/> + * * All options with an empty value will be removed from this file. - * <p/> + * * Moreover, like {@link #saveForUser(String...)} the given * {@code excludeKeys} will never be saved. - * <p/> + * * This method can be useful when migrating some configuration from a * version to another one with deprecated options (otherwise they will stay * for ever in the configuration file with an empty value which is not * acceptable). - * <p/> + * * <strong>Important note:</strong> Using this method can have some strange * side effects, since it could then allow to reuse default configurations * from other level (default, env, jvm,...). Use with care only! @@ -881,7 +881,7 @@ public class ApplicationConfig { /** * Get the encoding used to read/write resources. - * <p/> + * * This value is stored as an option using the * {@link #getEncodingOption()} key. * @@ -979,7 +979,7 @@ public class ApplicationConfig { /** * Use appName to add a context in config.file and config.path options. - * <p/> + * * Ex for an application named 'pollen' : {@code config.file} option becomes * {@code pollen.config.file} and {@code config.path} becomes * {@code pollen.config.path} @@ -1016,11 +1016,11 @@ public class ApplicationConfig { /** * Get configuration file path to use. - * <p/> + * * Use (in order) one of the following definition: * <ul> - * <li>{@link #CONFIG_PATH} option - * <li>system dependant path + * <li>{@link #CONFIG_PATH} option</li> + * <li>system dependant path</li> * </ul> * * @return path to use with endind {@link File#separator} @@ -1045,11 +1045,11 @@ public class ApplicationConfig { /** * Get system configuration path. - * <p/> + * * Currently supported: * <ul> - * <li>Windows : C:\Windows\System32 - * <li>Unix : /etc/ + * <li>Windows : C:\Windows\System32</li> + * <li>Unix : /etc/</li> * </ul> * * @return the system path @@ -1105,14 +1105,14 @@ public class ApplicationConfig { /** * Get user configuration path. - * <p/> + * * Currently supported: * <ul> - * <li>Windows : ${user.home}\\Application Data\\ - * <li>Max os x : ${user.home}/Library/Application Support - * <li>Unix : ${user.home}/.config + * <li>Windows : ${user.home}\\Application Data\\</li> + * <li>Max os x : ${user.home}/Library/Application Support</li> + * <li>Unix : ${user.home}/.config</li> * </ul> - * <p/> + * * Unix norm is based on freedesktop concept explained here : * http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html * @@ -1202,9 +1202,9 @@ public class ApplicationConfig { } /** - * recupere un objet de la class<E>, s'il n'existe pas encore, il est cree - * (il faut donc que class<E> soit instanciable - * <p/> + * recupere un objet de la class<E>, s'il n'existe pas encore, il est cree + * (il faut donc que class<E> soit instanciable + * * E peut prendre en argument du contruteur un objet de type ApplicationConfig * * @since 2.4.2 @@ -1216,9 +1216,9 @@ public class ApplicationConfig { /** * recupere un objet ayant le nom 'name', s'il n'existe pas encore, il est - * cree en utilisant la class<E>, sinon il est simplement caster vers cette + * cree en utilisant la class<E>, sinon il est simplement caster vers cette * classe. - * <p/> + * * E peut prendre en argument du contruteur un objet de type ApplicationConfig * * @since 2.4.2 @@ -1254,7 +1254,7 @@ public class ApplicationConfig { * retourne une nouvelle instance d'un objet dont on recupere la la class * dans la configuration via la cle 'key' et le cast en E. Retourne null * si la cle n'est pas retrouve - * <p/> + * * E peut prendre en argument du contruteur un objet de type ApplicationConfig * * @since 2.4.2 @@ -1268,7 +1268,7 @@ public class ApplicationConfig { * retourne l'objet instancier via la classe recupere dans la configuration * via la cle 'key'. Une fois instancie, le meme objet est toujours retourne. * On null si key n'est pas retrouve. - * <p/> + * * La classe peut avoir un constructeur prenant un ApplicationConfig * * @since 2.4.2 @@ -1286,7 +1286,7 @@ public class ApplicationConfig { * retourne l'objet caster en 'E', instancier via la classe recupere dans la * configuration via la cle 'key'. Une fois instancie, le meme objet est * toujours retourne. On null si key n'est pas retrouve - * <p/> + * * La classe peut avoir un constructeur prenant un ApplicationConfig * * @since 2.4.2 @@ -1319,7 +1319,7 @@ public class ApplicationConfig { /** * get option value as string. - * <p/> + * * Replace inner ${xxx} value. * * @param key the option's key @@ -1451,12 +1451,14 @@ public class ApplicationConfig { /** * Convert value in instance of clazz or List if asList is true - * <p/> + * * example: - * <li> convertOption(Boolean.class, "toto", "true,true", false) => false - * <li> convertOption(Boolean.class, "toto", null, false) => ? ConverterUtil dependant - * <li> convertOption(Boolean.class, "toto", "true,true", true) => [true, true] - * <li> convertOption(Boolean.class, "toto", null, true) => [] + * <ul> + * <li> convertOption(Boolean.class, "toto", "true,true", false) → false</li> + * <li> convertOption(Boolean.class, "toto", null, false) → ? ConverterUtil dependant</li> + * <li> convertOption(Boolean.class, "toto", "true,true", true) → [true, true]</li> + * <li> convertOption(Boolean.class, "toto", null, true) → []</li> + * </ul> * * @param clazz result type expected * @param key option key @@ -1546,7 +1548,7 @@ public class ApplicationConfig { /** * Get option value as {@link Properties}, this property must be a filepath * and file must be a properties. - * <p/> + * * Returned Properties is {@link RecursiveProperties}. * * @param key the option's key @@ -2253,9 +2255,9 @@ public class ApplicationConfig { /** * Action to save user configuration. - * <p/> + * * Add it as a listener of the configuration for a given property. - * <p/> + * * <b>Note:</b> Will not save if {@link #isAdjusting()} is {@code true}. * * @since 1.3 diff --git a/src/main/java/org/nuiton/config/ApplicationConfigHelper.java b/src/main/java/org/nuiton/config/ApplicationConfigHelper.java index bbdd6c4..c95115e 100644 --- a/src/main/java/org/nuiton/config/ApplicationConfigHelper.java +++ b/src/main/java/org/nuiton/config/ApplicationConfigHelper.java @@ -32,7 +32,7 @@ import java.util.Set; /** * Helper about {@link ApplicationConfig}. * - * @author tchemit <chemit@codelutin.com> + * @author Tony Chemit - chemit@codelutin.com * @since 2.4.8 */ public class ApplicationConfigHelper { @@ -196,7 +196,7 @@ public class ApplicationConfigHelper { /** * Get all option keys that should not be saved in the user config file * from the given options providers. - * <p/> + * * Such options are {@code transient} or {@code final}. * * @param providers providers to inspect diff --git a/src/main/java/org/nuiton/config/ApplicationConfigProvider.java b/src/main/java/org/nuiton/config/ApplicationConfigProvider.java index e9f3100..8be1eca 100644 --- a/src/main/java/org/nuiton/config/ApplicationConfigProvider.java +++ b/src/main/java/org/nuiton/config/ApplicationConfigProvider.java @@ -27,23 +27,23 @@ import java.util.ServiceLoader; /** * Provider of a {@link ApplicationConfig}. - * <p/> + * * Each library of application which use {@link ApplicationConfig} should * implements this and add the provider available via the * {@link ServiceLoader} mecanism. - * <p/> + * * Using such provider offers a nice way to find out what options can be loaded * in a application. It also offers a simply way to generate application * config report for documentation. * - * @author tchemit <chemit@codelutin.com> + * @author Tony Chemit - chemit@codelutin.com * @since 1.4.8 */ public interface ApplicationConfigProvider { /** * Returns the name of the provided application config. - * <p/> + * * This should be the name of the library or application which offers * the configuration. * diff --git a/src/main/java/org/nuiton/config/ApplicationConfigSaveException.java b/src/main/java/org/nuiton/config/ApplicationConfigSaveException.java index 0cf9e07..d4f89c4 100644 --- a/src/main/java/org/nuiton/config/ApplicationConfigSaveException.java +++ b/src/main/java/org/nuiton/config/ApplicationConfigSaveException.java @@ -25,7 +25,7 @@ package org.nuiton.config; /** * throw if any error when saving configuration. * - * @author tchemit <chemit@codelutin.com> + * @author Tony Chemit - chemit@codelutin.com * @since 3.0 */ public class ApplicationConfigSaveException extends RuntimeException { diff --git a/src/main/java/org/nuiton/config/ArgumentsParserException.java b/src/main/java/org/nuiton/config/ArgumentsParserException.java index e547c7f..4e63b95 100644 --- a/src/main/java/org/nuiton/config/ArgumentsParserException.java +++ b/src/main/java/org/nuiton/config/ArgumentsParserException.java @@ -25,7 +25,7 @@ package org.nuiton.config; /** * Argument parsing exception. * - * @author Benjamin Poussin <poussin@codelutin.com> + * @author Benjamin Poussin - poussin@codelutin.com * @since 2.7 */ public class ArgumentsParserException extends Exception { diff --git a/src/main/java/org/nuiton/config/ConfigActionDef.java b/src/main/java/org/nuiton/config/ConfigActionDef.java index 5148ea5..9afc652 100644 --- a/src/main/java/org/nuiton/config/ConfigActionDef.java +++ b/src/main/java/org/nuiton/config/ConfigActionDef.java @@ -27,9 +27,9 @@ import java.io.Serializable; /** * Le contrat de marquage des actions, on utilise cette interface pour * caracteriser une action. - * <p/> + * * Ex : - * <p/> + * * <pre> * public enum MyAppConfigAction implements ConfigActionDef { * HELP(MyAppHelpAction.class.getName() + "#show", "-h", "--help"); @@ -55,7 +55,7 @@ import java.io.Serializable; * </pre> * * @author sletellier - * @author tchemit <chemit@codelutin.com> + * @author Tony Chemit - chemit@codelutin.com * @since 2.6.10 */ public interface ConfigActionDef extends Serializable { diff --git a/src/main/java/org/nuiton/config/ConfigOptionDef.java b/src/main/java/org/nuiton/config/ConfigOptionDef.java index 92a3e44..54058f9 100644 --- a/src/main/java/org/nuiton/config/ConfigOptionDef.java +++ b/src/main/java/org/nuiton/config/ConfigOptionDef.java @@ -27,7 +27,7 @@ import java.io.Serializable; /** * Le contrat de marquage des options, on utilise cette interface pour * caracteriser une option de configuration. - * <p/> + * * <pre> * public enum MyConfigOption implements ConfigOptionDef { * @@ -46,12 +46,12 @@ import java.io.Serializable; * public String key; * public String description; * public String defaultValue; - * public Class<?> type; + * public Class<?> type; * public boolean isTransient; * public boolean isFinal; * * private WikittyConfigOption(String key, String description, - * String defaultValue, Class<?> type, boolean isTransient, boolean isFinal) { + * String defaultValue, Class<?> type, boolean isTransient, boolean isFinal) { * this.key = key; * this.description = description; * this.defaultValue = defaultValue; @@ -86,7 +86,7 @@ import java.io.Serializable; * } * * @Override - * public Class<?> getType() { + * public Class<?> getType() { * return type; * } * diff --git a/src/main/java/org/nuiton/config/SubApplicationConfig.java b/src/main/java/org/nuiton/config/SubApplicationConfig.java index 88b5b0b..f4b7ebf 100644 --- a/src/main/java/org/nuiton/config/SubApplicationConfig.java +++ b/src/main/java/org/nuiton/config/SubApplicationConfig.java @@ -34,15 +34,15 @@ import java.util.Properties; * monOption=toto * monPrefix.monOption=titi * </pre> - * <p/> + * <ul> * <li>Si on cree le subApp avec le prefix "monPrefix." et qu'on demande la valeur - * de "monOption", la valeur retournee est "titi". + * de "monOption", la valeur retournee est "titi".</li> * <li>Si on cree le subApp avec le prefix "monAutrePrefix." et qu'on demande la valeur - * de "monOption", la valeur retournee est "toto" (valeur par defaut de monOption. - * <p/> + * de "monOption", la valeur retournee est "toto" (valeur par defaut de monOption.</li> + * </ul> * Certaines methodes retournees ne sont pas * surchargee et ne masque pas le prefix: - * <li>getOptions() + * <ul><li>getOptions()</li></ul> * * @since 2.4.9 */ diff --git a/src/test/java/org/nuiton/config/ApplicationConfigTest.java b/src/test/java/org/nuiton/config/ApplicationConfigTest.java index 8f0380f..a859865 100644 --- a/src/test/java/org/nuiton/config/ApplicationConfigTest.java +++ b/src/test/java/org/nuiton/config/ApplicationConfigTest.java @@ -55,8 +55,8 @@ import java.util.Map; import java.util.Properties; /** - * @author Benjamin Poussin <poussin@codelutin.com> - * @author tchemit <chemit@codelutin.com> + * @author Benjamin Poussin - poussin@codelutin.com + * @author Tony Chemit - chemit@codelutin.com * @since 2.6.10 */ public class ApplicationConfigTest { @@ -507,7 +507,7 @@ public class ApplicationConfigTest { /** * Test null options. - * <p/> + * * TODO EC20100503 this test throw a huge exception * * @throws Exception -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.