This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository nuiton-utils. See http://git.nuiton.org/nuiton-utils.git commit 19ab5ac7583324af41a004bf0610e4df71854888 Author: Tony CHEMIT <chemit@codelutin.com> Date: Sun Jan 10 13:45:34 2016 +0100 Second pass to add FIXME on missing javadoc params and return (See #3797) --- src/main/java/org/nuiton/util/AliasMap.java | 25 +-- src/main/java/org/nuiton/util/ArrayUtil.java | 5 +- src/main/java/org/nuiton/util/BoundedList.java | 8 +- .../util/BoundedListOutOfBoundsException.java | 10 -- src/main/java/org/nuiton/util/CallAnalyse.java | 1 + .../java/org/nuiton/util/CardinalityHelper.java | 4 +- src/main/java/org/nuiton/util/CollectionUtil.java | 7 + src/main/java/org/nuiton/util/DateUtil.java | 14 +- src/main/java/org/nuiton/util/DigestGenerator.java | 70 ++++---- src/main/java/org/nuiton/util/FileUtil.java | 177 ++++++++++--------- src/main/java/org/nuiton/util/GZUtil.java | 22 ++- .../java/org/nuiton/util/LoggingException.java | 1 - .../org/nuiton/util/LoggingPatternFormatter.java | 67 ++++--- src/main/java/org/nuiton/util/MatrixMap.java | 194 ++++++++++++--------- src/main/java/org/nuiton/util/ObjectUtil.java | 27 +-- .../java/org/nuiton/util/ResourceException.java | 1 - .../org/nuiton/util/ResourceNotFoundException.java | 1 - src/main/java/org/nuiton/util/SemVer.java | 171 ++++++++++-------- src/main/java/org/nuiton/util/StringUtil.java | 2 +- .../java/org/nuiton/util/StringUtilException.java | 1 - src/main/java/org/nuiton/util/ZipUtil.java | 2 +- src/main/java/org/nuiton/util/beans/BeanUtil.java | 1 + src/main/java/org/nuiton/util/beans/Binder.java | 2 +- .../java/org/nuiton/util/beans/BinderFactory.java | 2 + .../org/nuiton/util/beans/BinderModelBuilder.java | 100 ++++++----- .../util/converter/FormatConverterFactory.java | 10 +- .../java/org/nuiton/util/converter/FormatMap.java | 4 +- src/main/java/org/nuiton/util/version/SemVer.java | 63 +++---- .../java/org/nuiton/util/version/Versions.java | 18 +- 29 files changed, 567 insertions(+), 443 deletions(-) diff --git a/src/main/java/org/nuiton/util/AliasMap.java b/src/main/java/org/nuiton/util/AliasMap.java index b690dc1..62a82ac 100644 --- a/src/main/java/org/nuiton/util/AliasMap.java +++ b/src/main/java/org/nuiton/util/AliasMap.java @@ -76,8 +76,9 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * * @param key identifiant unique pour cette valeur * @param value la valeur + * @param alias1 le premier alias à saisir * @param alias les alias de la valeur - * @return + * @return FIXME */ public V put(K key, V value, A alias1, A ... alias) { V result = put(key, value); @@ -88,9 +89,9 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { /** * Ajoute des alias a une cle - * @param key - * @param alias1 - * @param alias + * @param key FIXME + * @param alias1 FIXME + * @param alias FIXME */ protected void putAlias(K key, A alias1, A ... alias) { aliases.put(alias1, key); @@ -117,7 +118,7 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * </pre> * * - * @param alias + * @param alias FIXME * @return une liste vide si aucune valeur ne correspond au alias en argument */ public Collection<K> getKeyAlias(A ... alias) { @@ -154,7 +155,7 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * </pre> * * - * @param alias + * @param alias FIXME * @return une liste vide si aucune valeur ne correspond au alias en argument */ public Collection<V> getValueAlias(A ... alias) { @@ -179,8 +180,8 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * getKeyAlias(k9) retourne [] * </pre> * - * @param key - * @return + * @param key FIXME + * @return FIXME */ public Collection<A> getAlias(K key) { Collection result = keys.getCollection(key); @@ -201,8 +202,8 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * remove(K1) il reste K2: [b, c, d], K3: [c, d, e] * </pre> * - * @param key - * @return + * @param key FIXME + * @return FIXME */ @Override public V remove(Object key) { @@ -231,7 +232,7 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * removeValue(b, c) il reste K3: [c, d, e] * </pre> * - * @param alias + * @param alias FIXME * @return la liste de valeur qui a ete supprime de la map */ public Collection<V> removeValue(A ... alias) { @@ -256,7 +257,7 @@ public class AliasMap<K, V, A> extends HashMap<K, V> { * getKeyAlias(z) alors rien ne change car cette alias n'existe pas * </pre> * - * @param alias + * @param alias FIXME */ public void removeAlias(A ... alias) { for (Object a : alias) { diff --git a/src/main/java/org/nuiton/util/ArrayUtil.java b/src/main/java/org/nuiton/util/ArrayUtil.java index 3e9731d..a6870cc 100644 --- a/src/main/java/org/nuiton/util/ArrayUtil.java +++ b/src/main/java/org/nuiton/util/ArrayUtil.java @@ -23,7 +23,7 @@ /** * ArrayUtil.java - * + * <p> * Created: 31 oct. 2004 * * @author Benjamin Poussin <poussin@codelutin.com> @@ -130,6 +130,8 @@ public class ArrayUtil { // ArrayUtil * Ajoute a un tableau un ensemble d'element. Le type du tableau retourné * est le meilleur possible. * + * @param <E> FIXME + * @param <F> FIXME * @param tab les valeurs initiales du tableau * @param elems les elemements a ajouter * @return un nouveau tableau contenant a la fin les elements souhaites @@ -145,6 +147,7 @@ public class ArrayUtil { // ArrayUtil * Recherche dans le table le 1er element qui correspond a la classe * passée en argument. * + * @param <A> FIXME * @param tab le tableau dans lequel il faut chercher * @param clazz la classe de l'objet souhaité * @return un objet de la classe demandé, ou null si aucun ne correspond diff --git a/src/main/java/org/nuiton/util/BoundedList.java b/src/main/java/org/nuiton/util/BoundedList.java index 929beb0..18d8893 100644 --- a/src/main/java/org/nuiton/util/BoundedList.java +++ b/src/main/java/org/nuiton/util/BoundedList.java @@ -64,7 +64,7 @@ public class BoundedList<E> extends ArrayList<E> { /** * Creates a new BoundedList with the specified initialCapacity. The min size is set to 0 and the max size to the infinite. * - * @param initialCapacity + * @param initialCapacity FIXME */ public BoundedList(int initialCapacity) { super(initialCapacity); @@ -78,7 +78,7 @@ public class BoundedList<E> extends ArrayList<E> { /** * Creates a new BoundedList with the specified collection of elements. The min size is set to 0 and the max size to the infinite. * - * @param arg0 + * @param arg0 FIXME */ public BoundedList(Collection<E> arg0) { super(arg0); @@ -87,8 +87,8 @@ public class BoundedList<E> extends ArrayList<E> { /** * Creates a new empty BoundedList with the specified min and max sizes. Please be informed that -1 represents the infinite. * - * @param minSize - * @param maxSize + * @param minSize FIXME + * @param maxSize FIXME */ public BoundedList(int minSize, int maxSize) { super(); diff --git a/src/main/java/org/nuiton/util/BoundedListOutOfBoundsException.java b/src/main/java/org/nuiton/util/BoundedListOutOfBoundsException.java index 3743ba3..bca1a89 100644 --- a/src/main/java/org/nuiton/util/BoundedListOutOfBoundsException.java +++ b/src/main/java/org/nuiton/util/BoundedListOutOfBoundsException.java @@ -35,30 +35,20 @@ package org.nuiton.util; public class BoundedListOutOfBoundsException extends RuntimeException { - /** */ private static final long serialVersionUID = 7006384682459926080L; - /** - * - */ public BoundedListOutOfBoundsException() { super(); } - /** @param message */ public BoundedListOutOfBoundsException(String message) { super(message); } - /** - * @param message - * @param cause - */ public BoundedListOutOfBoundsException(String message, Throwable cause) { super(message, cause); } - /** @param cause */ public BoundedListOutOfBoundsException(Throwable cause) { super(cause); } diff --git a/src/main/java/org/nuiton/util/CallAnalyse.java b/src/main/java/org/nuiton/util/CallAnalyse.java index 2819fcd..8a4b934 100644 --- a/src/main/java/org/nuiton/util/CallAnalyse.java +++ b/src/main/java/org/nuiton/util/CallAnalyse.java @@ -87,6 +87,7 @@ public class CallAnalyse { // CallAnalyse /** * Permet de savoir si les statistiques sont activées ou non, pour le * thread courant + * @return FIXME */ public static boolean isActivate() { return stats.get().getActivated(); diff --git a/src/main/java/org/nuiton/util/CardinalityHelper.java b/src/main/java/org/nuiton/util/CardinalityHelper.java index 9e71477..0e183d5 100644 --- a/src/main/java/org/nuiton/util/CardinalityHelper.java +++ b/src/main/java/org/nuiton/util/CardinalityHelper.java @@ -86,7 +86,7 @@ public class CardinalityHelper { * * @param min le min de la cardinalité à tester * @param max le max de la cardinalité à tester - * @return {@code true} si min==0 && max==1 + * @return {@code true} si min==0 et max==1 */ public static boolean isDefaultOptional(int min, int max) { return min == 0 && max == 1; @@ -96,7 +96,7 @@ public class CardinalityHelper { * Indique si une cardinalité est obligatoire à partir de son min * * @param min le min de la cardinalité à tester - * @return {@code true} if min>0 + * @return {@code true} si min>0 */ public static boolean isMandatory(int min) { return min > 0; diff --git a/src/main/java/org/nuiton/util/CollectionUtil.java b/src/main/java/org/nuiton/util/CollectionUtil.java index 7cf792e..ce6cee2 100644 --- a/src/main/java/org/nuiton/util/CollectionUtil.java +++ b/src/main/java/org/nuiton/util/CollectionUtil.java @@ -40,6 +40,8 @@ public class CollectionUtil { /** * Ajoute a la collection tous les elements passés en parametre * + * @param <A> FIXME + * @param <E> FIXME * @param col la collection * @param e les elements a ajouter * @return la collection passé en parametre @@ -52,6 +54,8 @@ public class CollectionUtil { /** * Ajoute a la liste tous les elements passés en parametre * + * @param <A> FIXME + * @param <E> FIXME * @param col la liste * @param pos le premier index où insérer les données * @param e les elements a ajouter @@ -71,6 +75,7 @@ public class CollectionUtil { * <p> * Note : <b>Aucune liste n'est créee, ni recopiée</b> * + * @param <O> data type * @param list la liste à convertir * @param type le type des éléments de la liste * @return la liste typée @@ -102,6 +107,7 @@ public class CollectionUtil { * <p> * Note : <b>Aucune collection n'est créee, ni recopiée</b> * + * @param <O> data type * @param list la collection à convertir * @param type le type des éléments de la collection * @return la collection typée @@ -133,6 +139,7 @@ public class CollectionUtil { * <p> * Note : <b>Aucun ensemble n'est créee, ni recopiée</b> * + * @param <O> data type * @param list l'ensemble à convertir * @param type le type des éléments de l'ensemble * @return l'ensemble typée diff --git a/src/main/java/org/nuiton/util/DateUtil.java b/src/main/java/org/nuiton/util/DateUtil.java index 860985d..fbc836b 100644 --- a/src/main/java/org/nuiton/util/DateUtil.java +++ b/src/main/java/org/nuiton/util/DateUtil.java @@ -32,7 +32,7 @@ import java.util.Locale; /** * Library for manipulating dates. - * + * <p> * <b>Note: </b> * * @author fdesbois @@ -243,7 +243,7 @@ public class DateUtil { boolean result = true; result &= myDate.after(beforeDate) || myDate.compareTo(beforeDate) == 0; result &= afterDate == null || myDate.before(afterDate) || - myDate.compareTo(afterDate) == 0; + myDate.compareTo(afterDate) == 0; return result; } @@ -487,8 +487,10 @@ public class DateUtil { * Créer la date qui utilise le jour donné dans {@code day} et l'heure * donnée dans {@code time}. * - * @param day le jour à utiliser - * @param time l'heure a utiliser + * @param day le jour à utiliser + * @param time l'heure a utiliser + * @param useSecond FIXME + * @param useMiliSecond FIXME * @return la date donnée avec l'heure courante */ public static Date getDateAndTime(Date day, Date time, boolean useSecond, boolean useMiliSecond) { @@ -518,7 +520,9 @@ public class DateUtil { * Créer la date qui utilise uniquement l'heure * donnée dans {@code dayTime}. * - * @param dayTime l'heure a utiliser + * @param dayTime l'heure a utiliser + * @param useSecond FIXME + * @param useMiliSecond FIXME * @return la date donnée avec uniquement l'heure courante */ public static Date getTime(Date dayTime, boolean useSecond, boolean useMiliSecond) { diff --git a/src/main/java/org/nuiton/util/DigestGenerator.java b/src/main/java/org/nuiton/util/DigestGenerator.java index 15f2eb6..aa16592 100644 --- a/src/main/java/org/nuiton/util/DigestGenerator.java +++ b/src/main/java/org/nuiton/util/DigestGenerator.java @@ -64,10 +64,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for Document * - * @param document - * @param digestAlgorithm + * @param document FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(Document document, String digestAlgorithm) throws Exception { @@ -102,10 +102,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for Node * - * @param node - * @param digestAlgorithm + * @param node FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest value - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(Node node, String digestAlgorithm) throws Exception { if (node.getNodeType() == Node.ELEMENT_NODE) { @@ -123,10 +123,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for Element * - * @param element - * @param digestAlgorithm + * @param element FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest value - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(Element element, String digestAlgorithm) throws Exception { @@ -168,10 +168,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for ProcessingInstruction * - * @param pi - * @param digestAlgorithm + * @param pi FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest value - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(ProcessingInstruction pi, String digestAlgorithm) throws Exception { @@ -198,10 +198,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for Attr * - * @param attribute - * @param digestAlgorithm + * @param attribute FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest value - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(Attr attribute, String digestAlgorithm) throws Exception { @@ -232,10 +232,10 @@ public class DigestGenerator { /** * This method is an overloaded method for the digest generation for Text * - * @param text - * @param digestAlgorithm + * @param text FIXME + * @param digestAlgorithm FIXME * @return Returns a byte array representing the calculated digest value - * @throws Exception + * @throws Exception FIXME */ public byte[] getDigest(Text text, String digestAlgorithm) throws Exception { byte[] digest; @@ -259,7 +259,7 @@ public class DigestGenerator { * This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for * Element * - * @param element + * @param element FIXME * @return Returns the expanded name of Element */ public String getExpandedName(Element element) { @@ -270,7 +270,7 @@ public class DigestGenerator { * This method is an overloaded method for getting the expanded name namespaceURI followed by the local name for * Attr * - * @param attribute + * @param attribute FIXME * @return Returns the expanded name of the Attr */ public String getExpandedName(Attr attribute) { @@ -280,7 +280,7 @@ public class DigestGenerator { /** * Gets the collection of attributes which are none namespace declarations for an Element * - * @param element + * @param element FIXME * @return Returns the collection of attributes which are none namespace declarations */ public Collection getAttributesWithoutNS(Element element) { @@ -298,7 +298,7 @@ public class DigestGenerator { /** * Gets the valid element collection of an Document. Element and ProcessingInstruction only * - * @param document + * @param document FIXME * @return Returns a collection of ProcessingInstructions and Elements */ public Collection getValidElements(Document document) { @@ -317,7 +317,7 @@ public class DigestGenerator { /** * Gets the String representation of the byte array * - * @param array + * @param array FIXME * @return Returns the String of the byte */ public String getStringRepresentation(byte[] array) { @@ -331,11 +331,11 @@ public class DigestGenerator { /** * Compares two Nodes for the XML equality * - * @param node - * @param comparingNode - * @param digestAlgorithm + * @param node FIXME + * @param comparingNode FIXME + * @param digestAlgorithm FIXME * @return Returns true if the Node XML contents are equal - * @throws Exception + * @throws Exception FIXME */ public boolean compareNode(Node node, Node comparingNode, String digestAlgorithm) throws Exception { @@ -346,11 +346,11 @@ public class DigestGenerator { /** * Compares two Documents for the XML equality * - * @param document - * @param comparingDocument - * @param digestAlgorithm + * @param document FIXME + * @param comparingDocument FIXME + * @param digestAlgorithm FIXME * @return Returns true if the Document XML content are equal - * @throws Exception + * @throws Exception FIXME */ public boolean compareDocument(Document document, Document comparingDocument, String digestAlgorithm) @@ -362,11 +362,11 @@ public class DigestGenerator { /** * Compares two Attributes for the XML equality * - * @param attribute - * @param comparingAttribute - * @param digestAlgorithm + * @param attribute FIXME + * @param comparingAttribute FIXME + * @param digestAlgorithm FIXME * @return Returns true if the Document XML content are equal - * @throws Exception + * @throws Exception FIXME */ public boolean compareAttribute(Attr attribute, Attr comparingAttribute, String digestAlgorithm) throws Exception { diff --git a/src/main/java/org/nuiton/util/FileUtil.java b/src/main/java/org/nuiton/util/FileUtil.java index 0221cba..7799ef0 100644 --- a/src/main/java/org/nuiton/util/FileUtil.java +++ b/src/main/java/org/nuiton/util/FileUtil.java @@ -66,7 +66,7 @@ import java.util.regex.Pattern; * temporaire, comparaison de dates de création, récupération d'une chaîne, * d'un Reader ou d'un Writer à partir d'un fichier, récupération du fichier * saisi dans une boîte de dialogue, conversions en byte[], en Stream... - * + * <p> * Created: 22 novembre 2004 * * @author Benjamin Poussin - poussin@codelutin.com @@ -74,25 +74,30 @@ import java.util.regex.Pattern; */ public class FileUtil { // FileUtil - /** Logger. */ + /** + * Logger. + */ static private Log log = LogFactory.getLog(FileUtil.class); - /** Encoding utilisé (peut être redéfini) */ + /** + * Encoding utilisé (peut être redéfini) + */ // TODO fdesbois 2011-04-16 : Perhaps change ISO encoding by UTF-8 public static String ENCODING = "ISO-8859-1"; /** * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated protected static File currentDirectory = new File("."); /** + * @param dir FIXME * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static void setCurrentDirectory(File dir) { @@ -100,9 +105,10 @@ public class FileUtil { // FileUtil } /** + * @return FIXME * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getCurrentDirectory() { @@ -111,8 +117,8 @@ public class FileUtil { // FileUtil /** * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static class PatternChooserFilter extends javax.swing.filechooser.FileFilter { @@ -147,8 +153,8 @@ public class FileUtil { // FileUtil * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(String... patternOrDescriptionFilters) { @@ -164,8 +170,8 @@ public class FileUtil { // FileUtil * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(javax.swing.filechooser.FileFilter... filters) { @@ -183,8 +189,8 @@ public class FileUtil { // FileUtil * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(Component parent, @@ -206,8 +212,8 @@ public class FileUtil { // FileUtil * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @see #getFile(javax.swing.filechooser.FileFilter...) * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(String title, @@ -241,8 +247,8 @@ public class FileUtil { // FileUtil * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(Component parent, @@ -261,8 +267,8 @@ public class FileUtil { // FileUtil * @param filters les filtres a ajouter * @return le fichier accepté, ou null si rien n'est chois ou l'utilisateur a annulé * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static File getFile(String title, @@ -300,11 +306,11 @@ public class FileUtil { // FileUtil /** * @return le nom du repertoire entre dans la boite de dialogue. - * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne - * null. + * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne + * null. * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static String getDirectory() { @@ -315,11 +321,11 @@ public class FileUtil { // FileUtil * @param title le nom de la boite de dialogue * @param approvalText le texte de l'action d'acceptation du répertoire dans le file chooser * @return le nom du repertoire entre dans la boite de dialogue. - * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne - * null. + * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne + * null. * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static String getDirectory(String title, String approvalText) { @@ -332,11 +338,11 @@ public class FileUtil { // FileUtil * @param title le nom de la boite de dialogue * @param approvalText le texte de l'action d'acceptation du répertoire dans le file chooser * @return le nom du repertoire entre dans la boite de dialogue. - * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne - * null. + * Si le bouton annuler est utilisé, ou qu'il y a une erreur retourne + * null. * @deprecated since 2.6.13, prefer use same method in - * jaxx.runtime.FileChooserUtil class in jaxx-runtime project - * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} + * jaxx.runtime.FileChooserUtil class in jaxx-runtime project + * (see http://svn.nuiton.org/svn/jaxx/trunk/jaxx-runtime/src/main/java/jaxx/runtime/FileChooserUtil} */ @Deprecated public static String getDirectory(Component parent, @@ -549,7 +555,7 @@ public class FileUtil { // FileUtil public static File getTempFile(String content, String fileSuffix) throws IOException { File result = File.createTempFile("tmp-" + FileUtil.class.getName(), - fileSuffix); + fileSuffix); result.deleteOnExit(); FileUtils.write(result, content); return result; @@ -584,7 +590,7 @@ public class FileUtil { // FileUtil for (String suffixe : suffixes) { if (result.endsWith(suffixe)) { result = result.substring(0, - result.length() - suffixe.length()); + result.length() - suffixe.length()); break; } } @@ -598,7 +604,7 @@ public class FileUtil { // FileUtil * @param extchars la liste des caracteres pouvant former l'extension * dans l'ordre de preference. Si vide on utilise ".". * @return l'extension ou la chaine vide si le fichier n'a pas d'extension - * l'extension ne contient pas le chaine de delimitation + * l'extension ne contient pas le chaine de delimitation */ public static String extension(File file, String... extchars) { String name = file.getName(); @@ -613,7 +619,7 @@ public class FileUtil { // FileUtil * @param extchars la liste des caracteres pouvant former l'extension * dans l'ordre de preference. Si vide on utilise ".". * @return l'extension ou la chaine vide si le fichier n'a pas d'extension - * l'extension ne contient pas le chaine de delimitation + * l'extension ne contient pas le chaine de delimitation * @since 1.4.2 */ public static String extension(String name, String... extchars) { @@ -668,7 +674,7 @@ public class FileUtil { // FileUtil String extension = extension(name, extchars); if (extension == null) { throw new IOException("Could not find extension for name " + - name + " within " + Arrays.toString(extchars)); + name + " within " + Arrays.toString(extchars)); } String nameWithoutExtension = name.substring( 0, name.length() - extension.length()); @@ -711,8 +717,8 @@ public class FileUtil { // FileUtil * * @param directory un répertoire * @return une liste d'objet {@link File} de répertoires et ceci - * recursivement à partir de directory, si directory - * n'est pas un répertoire la liste est vide. + * recursivement à partir de directory, si directory + * n'est pas un répertoire la liste est vide. */ public static List<File> getSubDirectories(File directory) { class DirectoryFilter implements FileFilter { @@ -729,8 +735,8 @@ public class FileUtil { // FileUtil * * @param directory un répertoire * @return une liste d'objet {@link File} des fichiers et ceci - * recursivement à partir de directory, si directory n'est pas un - * répertoire la liste est vide + * recursivement à partir de directory, si directory n'est pas un + * répertoire la liste est vide */ public static List<File> getFiles(File directory) { class NormalFileFilter implements FileFilter { @@ -751,7 +757,7 @@ public class FileUtil { // FileUtil * liste résultante * @param recursively flag pour indiquer si on doit descendre dans les sous répertoires * @return une liste d'objet {@link File} qui ont s'attisfait le - * pattern. + * pattern. */ public static List<File> find(File directory, final String pattern, @@ -812,8 +818,8 @@ public class FileUtil { // FileUtil * @param f le fichier ou répertoire à partir duquel il faut commencer * @param fileAction l'action à effectuer sur chaque fichier * @return le résultat des fileAction executé sur les fichiers, chaque - * résultat de FileAction sont assemblé par un ET logique pour donner - * le résultat final + * résultat de FileAction sont assemblé par un ET logique pour donner + * le résultat final */ public static boolean walkAfter(File f, FileAction fileAction) { boolean result = fileAction.doAction(f); @@ -834,8 +840,8 @@ public class FileUtil { // FileUtil * @param f le fichier ou répertoire à partir duquel il faut commencer * @param fileAction l'action à effectuer sur chaque fichier * @return le résultat des fileAction executé sur les fichiers, chaque - * résultat de FileAction sont assemblé par un ET logique pour donner - * le résultat final + * résultat de FileAction sont assemblé par un ET logique pour donner + * le résultat final */ public static boolean walkBefore(File f, FileAction fileAction) { boolean result = true; @@ -850,7 +856,7 @@ public class FileUtil { // FileUtil /** * Copie recursivement le repertoire source dans le repertoire destination - * + * <p> * copyRecursively("/truc/titi", "/var/tmp") donnera le repertoire * "/var/tmp/titi" * @@ -868,7 +874,7 @@ public class FileUtil { // FileUtil /** * Copie recursivement le repertoire source dans le repertoire destination - * + * <p> * copyRecursively("/truc/titi", "/var/tmp", "bidulle") donnera le repertoire * "/var/tmp/bidulle", 'bidulle' remplacant 'titi' * @@ -886,18 +892,18 @@ public class FileUtil { // FileUtil String renameTo, String... includePatterns) throws IOException { copyAndRenameRecursively(srcDir, - destDir, - true, - renameFrom, - renameTo, - false, - includePatterns + destDir, + true, + renameFrom, + renameTo, + false, + includePatterns ); } /** * Copie recursivement le repertoire source dans le repertoire destination - * + * <p> * copyRecursively("/truc/titi", "/var/tmp", "bidulle") donnera le repertoire * "/var/tmp/bidulle", 'bidulle' remplacant 'titi' * @@ -999,9 +1005,9 @@ public class FileUtil { // FileUtil /** * Use the linePattern to break the given CharBuffer into lines, applying * the input pattern to each line to see if we have a match - * + * <p> * Code taken from : - * + * <p> * http://java.sun.com/javase/6/docs/technotes/guides/io/example/Grep.java * * @param regex regex to search into file @@ -1046,11 +1052,11 @@ public class FileUtil { // FileUtil /** * Java implementation for the unix grep command. - * + * <p> * Code taken from : - * + * <p> * http://java.sun.com/javase/6/docs/technotes/guides/io/example/Grep.java - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1058,7 +1064,7 @@ public class FileUtil { // FileUtil * @param f file to search into * @param encoding encoding to use * @return matching lines (or {code null} if no matching lines) - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static List<CharSequence> grep(String searchRegex, @@ -1101,7 +1107,7 @@ public class FileUtil { // FileUtil /** * Java implementation for the unix grep command. - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1110,7 +1116,7 @@ public class FileUtil { // FileUtil * @param fileRegex regex for file to find in {@code rootDirectory} * @param encoding encoding to use * @return all matching lines for each files - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static Map<File, List<CharSequence>> grep(String searchRegex, @@ -1131,7 +1137,7 @@ public class FileUtil { // FileUtil /** * Search for files matching regex in current directory. - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1139,24 +1145,24 @@ public class FileUtil { // FileUtil * @param fileRegex regex for file to find in current dir * @param encoding encoding to use * @return all matching lines for each files - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static Map<File, List<CharSequence>> grep(String searchRegex, String fileRegex, String encoding) throws IOException { Map<File, List<CharSequence>> results = grep(searchRegex, - new File("."), - fileRegex, - encoding); + new File("."), + fileRegex, + encoding); return results; } /** * Sed implementation for a single file. - * + * <p> * Oginal source code from http://kickjava.com/src/org/apache/lenya/util/SED.java.htm. - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1164,7 +1170,7 @@ public class FileUtil { // FileUtil * @param replace Prefix which is going to replace the original * @param file File which sed shall be applied * @param encoding charset encoding - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static void sed(String searchRegex, @@ -1208,7 +1214,7 @@ public class FileUtil { // FileUtil /** * Java implementation for the unix sed command. - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1217,7 +1223,7 @@ public class FileUtil { // FileUtil * @param rootDirectory directory to search into * @param fileRegex regex for file to find in {@code rootDirectory} * @param encoding encoding to use - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static void sed(String searchRegex, @@ -1233,7 +1239,7 @@ public class FileUtil { // FileUtil /** * Java implementation for the unix sed command. - * + * <p> * May fail on windows with error : * The requested operation cannot be performed on a file with a user-mapped section open * @@ -1241,7 +1247,7 @@ public class FileUtil { // FileUtil * @param replace string to replace matching patterns * @param fileRegex regex for file to find in current dir * @param encoding encoding to use - * @throws IOException + * @throws IOException FIXME * @since 1.1.2 */ public static void sed(String searchRegex, @@ -1256,7 +1262,7 @@ public class FileUtil { // FileUtil * * @param dir the directory to create if not exisiting * @return {@code true} if directory was created, {@code false} if was no - * need to create it + * need to create it * @throws IOException if could not create directory * @since 1.3.2 */ @@ -1271,7 +1277,7 @@ public class FileUtil { // FileUtil /** * Obtain a file from the given {@code rootDirectory}, applying given paths. - * + * <p> * For example with paths = a, b and c, then result is : * <pre> * root/a/b/c @@ -1292,7 +1298,7 @@ public class FileUtil { // FileUtil /** * Obtain a file fro the given {@code rootDirectory}, applying the fqn. - * + * <p> * For example with fqn = a.b.c, the result is : * <pre> * root/a/b/c @@ -1312,9 +1318,8 @@ public class FileUtil { // FileUtil /** * Obtain a directory and creates it if required to place some test data. - * + * <p> * The directory will be : - * * <pre> * java.io.tmpdir/testclassName.fqn/methodName[/classifier]/timestamp * </pre> @@ -1334,14 +1339,14 @@ public class FileUtil { // FileUtil // create the directory to store database data String dataBasePath = testClassName.getName() - + File.separator // a directory with the test class name - + methodName; // a sub-directory with the method name + + File.separator // a directory with the test class name + + methodName; // a sub-directory with the method name if (StringUtils.isNotBlank(classifier)) { dataBasePath += classifier; } dataBasePath += '_' - + timestamp; // and a timestamp + + timestamp; // and a timestamp File databaseFile = new File(tempDirFile, dataBasePath); return databaseFile; } diff --git a/src/main/java/org/nuiton/util/GZUtil.java b/src/main/java/org/nuiton/util/GZUtil.java index a93d4ac..4bc6eec 100644 --- a/src/main/java/org/nuiton/util/GZUtil.java +++ b/src/main/java/org/nuiton/util/GZUtil.java @@ -49,7 +49,7 @@ public class GZUtil { // GZUtil /** * Tests if an inputStream is GZipped. - * + * <p> * <b>Note:</b> the stream is not closed and is reset. * * @param inputStream inputStream to test @@ -70,7 +70,10 @@ public class GZUtil { // GZUtil } - /** Retourne la string decompressee */ + /** + * @param in FIXME + * @return Retourne la string decompressee + */ public static StringBuffer bytesToStringBuffer(byte[] in) { try { if (in == null || in.length == 0) { @@ -90,17 +93,26 @@ public class GZUtil { // GZUtil } } - /** Retourne la string decompressee */ + /** + * @param in FIXME + * @return la string decompressee + */ public static String bytesToString(byte[] in) { return bytesToStringBuffer(in).toString(); } - /** Retourne la string compressee */ + /** + * @param elem FIXME + * @return Retourne la string compressee + */ public static byte[] stringBufferToBytes(StringBuffer elem) { return stringToBytes(elem.toString()); } - /** Retourne la string compressee */ + /** + * @param elem FIXME + * @return Retourne la string compressee + */ public static byte[] stringToBytes(String elem) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/src/main/java/org/nuiton/util/LoggingException.java b/src/main/java/org/nuiton/util/LoggingException.java index 1877c7e..41f4338 100644 --- a/src/main/java/org/nuiton/util/LoggingException.java +++ b/src/main/java/org/nuiton/util/LoggingException.java @@ -36,7 +36,6 @@ package org.nuiton.util; public class LoggingException extends RuntimeException { // LogException - /** */ private static final long serialVersionUID = 3495450140612716283L; public LoggingException(String msg) { diff --git a/src/main/java/org/nuiton/util/LoggingPatternFormatter.java b/src/main/java/org/nuiton/util/LoggingPatternFormatter.java index 2e76cb5..c0b350d 100644 --- a/src/main/java/org/nuiton/util/LoggingPatternFormatter.java +++ b/src/main/java/org/nuiton/util/LoggingPatternFormatter.java @@ -22,13 +22,13 @@ /** * PatternFormatter.java - * + * <p> * Created: Sat Apr 20 2002 * * @author POUSSIN Benjamin <bpoussin@free.fr> * Copyright Code Lutin - * - * + * <p> + * <p> * Mise a jour: $Date$ * par : $Author$ */ @@ -48,13 +48,11 @@ import java.util.logging.LogRecord; /** * Classe org.nuiton.logging.PatternFormatter. - * * <ul> * <li>n: new line</li> * <li>%: %</li> * <li>{: {</li> * </ul> - * * <ul> * <li>d: date</li> * </ul> @@ -72,18 +70,18 @@ import java.util.logging.LogRecord; * <li>a: argument</li> * <li>e: exception</li> * </ul> - * + * <p> * Sized element support justify pattern. - * {[+|-]<size>[:<maxPo>>]}. + * {[+|-]<size>[:<maxPo>]}. * '+' is * left justify, '-' rigth justify, size the prefered size for the element if it is not bigger. * If maxPos option is present blanc is not add if it go up to maxPos. - * + * <p> * SubString * <ul> * <li>M: method name</li> * </ul> - * + * <p> * L'element SubString a les memes possibilites que le pattern justify, * et permet en plus de suprimer une sous chaine, * cela permet de supprimer le debut du nom d'une classe. @@ -121,7 +119,12 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter } } - /** Methode qui formate le record */ + /** + * Methode qui formate le record + * + * @param record FIXME + * @return FIXME + */ public String format(LogRecord record) { StringBuffer result = new StringBuffer(); for (Iterator i = compile.iterator(); i.hasNext(); ) { @@ -146,7 +149,11 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter arguments.put("e", ExceptionArgument.class); } - /** Genere a partir de la chaine la liste des objet Argument. */ + /** + * Genere a partir de la chaine la liste des objet Argument. + * + * @param pattern FIXME + */ protected void compilePattern(String pattern) { compile = new ArrayList<Argument>(); String[] match = findNextPattern(pattern); @@ -161,8 +168,9 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter /** * Recherche dans la chaine le prochaine pattern. * + * @param s FIXME * @return un tableau de 3 chaines, [0] ce qu'il y a avant le - * parttern, [1] le parttern, [2] ce qu'il y a apres le pattern. + * parttern, [1] le parttern, [2] ce qu'il y a apres le pattern. */ protected String[] findNextPattern(String s) { String[] result = new String[]{"", "", ""}; @@ -181,7 +189,7 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter result[2] = s.substring(f + 1); } else { throw new LoggingException("Error, { at position " - + (d + 2) + " not terminated in :" + s); + + (d + 2) + " not terminated in :" + s); } } else { //pas de pattern result[0] = s.substring(0, d); @@ -195,7 +203,12 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter return result; } - /** Converti un pattern en un objet Argument */ + /** + * Converti un pattern en un objet Argument + * + * @param s FIXME + * @return FIXME + */ protected Argument patternToArgument(String s) { if (s.charAt(0) == 'n') { // new ligne return new StringArgument("\n"); @@ -211,18 +224,18 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter Class argumentClass = (Class) arguments.get(code); if (argumentClass == null) throw new LoggingException("Erreur dans le pattern '" + code - + "' inconnu"); + + "' inconnu"); Argument argument; try { argument = (Argument) argumentClass.newInstance(); } catch (InstantiationException eee) { throw new LoggingException( "Erreur lors de l'instanciation de l'objet Argument: " - + argumentClass.getName(), eee); + + argumentClass.getName(), eee); } catch (IllegalAccessException eee) { throw new LoggingException( "Erreur lors de l'instanciation de l'objet Argument: " - + argumentClass.getName(), eee); + + argumentClass.getName(), eee); } if (s.length() > 1) { // on a un pattern argument.setPattern(s.substring(2)); @@ -315,12 +328,12 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter if (left) { toAppendTo.append(s); while (0 < blanc-- - && (maxPos == -1 || toAppendTo.length() < maxPos)) { + && (maxPos == -1 || toAppendTo.length() < maxPos)) { toAppendTo.append(" "); } } else { while (0 < blanc-- - && (maxPos == -1 || toAppendTo.length() < maxPos)) { + && (maxPos == -1 || toAppendTo.length() < maxPos)) { toAppendTo.append(" "); } toAppendTo.append(s); @@ -330,10 +343,14 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter } static abstract protected class SubStringArgument extends SizedArgument { - /** la chaine qui doit etre supprimee */ + /** + * la chaine qui doit etre supprimee + */ protected String removeString = null; - /** vrai si la chaine doit etre retiree du debut, faux pour la fin */ + /** + * vrai si la chaine doit etre retiree du debut, faux pour la fin + */ protected boolean atBeginning = true; public SubStringArgument() { @@ -353,7 +370,7 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter removeString = subpattern[i].substring(1); } else if (subpattern[i].endsWith("*")) { removeString = subpattern[i].substring(0, subpattern[i] - .length() - 1); + .length() - 1); } } } @@ -373,7 +390,7 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter static abstract protected class OctetArgument extends SizedArgument { protected static final String[] UNITE = {"o", "Ko", "Mo", "Go", "To", - "Po"}; + "Po"}; protected int diviseur = 1024; @@ -408,7 +425,7 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter public StringBuffer toString(LogRecord record, StringBuffer toAppendTo) { return justify(toReadableSize(Runtime.getRuntime().freeMemory(), - UNITE, diviseur), toAppendTo); + UNITE, diviseur), toAppendTo); } } @@ -419,7 +436,7 @@ public class LoggingPatternFormatter extends Formatter { // PatternFormatter public StringBuffer toString(LogRecord record, StringBuffer toAppendTo) { return justify(toReadableSize(Runtime.getRuntime().totalMemory(), - UNITE, diviseur), toAppendTo); + UNITE, diviseur), toAppendTo); } } diff --git a/src/main/java/org/nuiton/util/MatrixMap.java b/src/main/java/org/nuiton/util/MatrixMap.java index 7c4af59..2bf7668 100644 --- a/src/main/java/org/nuiton/util/MatrixMap.java +++ b/src/main/java/org/nuiton/util/MatrixMap.java @@ -45,7 +45,7 @@ import java.util.RandomAccess; * Si lors de l'ajout on indique une dimension qui n'existe pas encore ou * un element dans une dimension qui n'existe pas, la matrice ajoute * automatiquement les elements manquant pour que l'ajout se passe bien. - * + * <p> * MatrixMap permet de stocker les elements avec des cles de n'importe quel * type. Les coordonnees utilisant ces objets sont converti en coordonnees * numeriques qui est la seul chose que sait gere Matrix. Ces coordonnees @@ -53,7 +53,7 @@ import java.util.RandomAccess; * dans Vector. On decoupe ainsi les problemes et on minimise le stockage et * certain traitement sur les données puisqu'au final toutes les données sont * dans une simple liste. - * + * <p> * Pour créer une nouvelle matrice, il faut utiliser une des méthodes de * {@link MatrixMap.Factory} * @@ -62,7 +62,9 @@ import java.util.RandomAccess; */ public interface MatrixMap<E> extends Iterable<E> { - /** Classe permettant la creation de matrice */ + /** + * Classe permettant la creation de matrice + */ class Factory { public static <T> MatrixMap<T> create(List... semantics) { MatrixMap<T> result = new MatrixMapFixed<T>(semantics); @@ -148,7 +150,7 @@ public interface MatrixMap<E> extends Iterable<E> { * * @param f la fonction a appliquer * @return Retourne la matrice elle meme. Les modifications sont faites directement - * dessus + * dessus */ MatrixMap<E> map(MapFunction<E> f); @@ -156,8 +158,8 @@ public interface MatrixMap<E> extends Iterable<E> { * Retourne l'element a une certaine position en utilisant des indices * ex: 2,3,1 * - * @param coordinates - * @return + * @param coordinates FIXME + * @return FIXME */ E getValueIndex(int... coordinates); @@ -166,15 +168,15 @@ public interface MatrixMap<E> extends Iterable<E> { * ex: 2,3,1 * * @param value la nouvelle valeur - * @param coordinates + * @param coordinates FIXME */ void setValueIndex(E value, int... coordinates); /** * Retourne l'element a une certaine position en utilisant les semantiques * - * @param coordinates - * @return + * @param coordinates FIXME + * @return FIXME */ E getValue(Object... coordinates); @@ -182,7 +184,7 @@ public interface MatrixMap<E> extends Iterable<E> { * Modifie l'element a une certaine position en utilisant les semantiques * * @param value la nouvelle valeur - * @param coordinates + * @param coordinates FIXME */ void setValue(E value, Object... coordinates); @@ -190,8 +192,8 @@ public interface MatrixMap<E> extends Iterable<E> { * Verifie que deux matrices sont completement equals * (dimension, semantique, nom, valeur, ...) * - * @param mat - * @return + * @param mat FIXME + * @return FIXME */ boolean equals(MatrixMap mat); @@ -199,7 +201,7 @@ public interface MatrixMap<E> extends Iterable<E> { * Verifie si les matrices sont egales en ne regardant que les valeurs et * pas les semantiques * - * @param mat + * @param mat FIXME * @return equality on values */ boolean equalsValues(MatrixMap<E> mat); @@ -207,7 +209,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Representation string de la matrice quelque soit le nombre de dimension * - * @return + * @return FIXME */ String toStringGeneric(); @@ -215,8 +217,8 @@ public interface MatrixMap<E> extends Iterable<E> { * Indique si les semantiques passées en argument sont valable pour la * matrice courante * - * @param semantics - * @return + * @param semantics FIXME + * @return FIXME */ boolean isValidCoordinates(Object[] semantics); @@ -260,7 +262,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Permet de prendre une sous matrice dans la matrice courante. - * + * <p> * Réalise plusieurs appels à {@link #getSubMatrix(int, Object...)} suivant * l'implémentation. * @@ -275,7 +277,7 @@ public interface MatrixMap<E> extends Iterable<E> { * seule dimension à un seul élément. * * @return une nouvelle matrice plus petite que la matrice actuelle ou egal - * s'il n'y a aucune dimension à supprimer + * s'il n'y a aucune dimension à supprimer */ MatrixMap<E> reduce(); @@ -297,7 +299,7 @@ public interface MatrixMap<E> extends Iterable<E> { * @param minNbDim le nombre minimum de dimension que l'on souhaite pour la * matrice résultat * @return une nouvelle matrice plus petite que la matrice actuelle ou egal - * s'il n'y a aucune dimension à supprimer + * s'il n'y a aucune dimension à supprimer */ MatrixMap<E> reduce(int minNbDim); @@ -306,8 +308,8 @@ public interface MatrixMap<E> extends Iterable<E> { * en parametre. La nouvelle matrice contient les données de l'ancienne * matrice par copie en fonction des semantiques * - * @param sems - * @return + * @param sems FIXME + * @return FIXME */ MatrixMap<E> extend(Object... sems); @@ -332,7 +334,7 @@ public interface MatrixMap<E> extends Iterable<E> { * @param o l'objet a convertir en string * @param length la longueur de representation souhaite * @param valueIfNull la valeur a utilise si l'objet est null - * @return + * @return FIXME */ public static String format(Object o, int length, String valueIfNull) { if (o == null) { @@ -360,8 +362,8 @@ public interface MatrixMap<E> extends Iterable<E> { * @param semantics la semantique à utilisé pour la conversion * @param coordinates les coordonnées à convertir * @return un tableau donnant les coordonnées sous forme semantique s'il n'y - * a pas de semantique (liste pleine de null) alors un objet Integer - * est créer pour représenter la semantique de la dimension. + * a pas de semantique (liste pleine de null) alors un objet Integer + * est créer pour représenter la semantique de la dimension. */ public static Object[] dimensionToSemantics(List[] semantics, int[] coordinates) { @@ -408,7 +410,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (result == -1) { throw new NoSuchElementException( "L'objet passé en argument n'a pas été retrouvé ou la dimension donnée ne convient pas:" - + o + " in " + semantics[dim]); + + o + " in " + semantics[dim]); } return result; } @@ -429,7 +431,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Iterateur de matrice * - * @param <E> + * @param <E> FIXME */ interface MatrixMapIterator<E> extends Iterator<E> { int[] getCoordinates(); @@ -492,7 +494,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (semantics != null) { int[] coordinates = getCoordinates(); result = MatrixHelper.dimensionToSemantics(semantics, - coordinates); + coordinates); } return result; } @@ -501,11 +503,11 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Collection particuliere utilisee pour la stockage des semantiques. - * + * <p> * Sert a optimiser la recherche de la position d'une donnee dans la liste. * Permet aussi de verifier qu'on ajoute pas de doublon dans la liste * - * @param <T> + * @param <T> FIXME */ class SemanticList<T> extends AbstractList<T> implements RandomAccess { @@ -589,20 +591,20 @@ public interface MatrixMap<E> extends Iterable<E> { * dimension qui n'existe pas, elle les ajoutes dans les semantiques. Ceci * n'est vrai que pour le set avec des semantiques, le set avec des indices * ne rend pas la matrice elastique. - * + * <p> * Cette classe fonctionne avec une matrice interne que l'on change lorsque * l'on a besoin de modifier les dimensions. Le changement de dimension * a donc un cout (creation d'une nouvelle matrice, copie des elements) - * + * <p> * Si on cree une sous matrice, et que l'on modifie la matrice mere * La sous matrice n'est pas impacter, puisqu'elle est base sur l'ancienne * represention interne de la matrice elastique, les deux matrices n'ont donc * plus de lien. - * + * <p> * Les methodes reduce et extend retourne de nouvelle matrice qui ne sont * pas elastique. Si on veut qu'elle le soit, il faut les reencapsuler * - * @param <E> + * @param <E> FIXME */ class MatrixMapElastic<E> implements MatrixMap<E> { @@ -771,9 +773,13 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Implantation de MatrixMap dont les dimensions sont fixees a la creation * Les dimensions ne change plus par la suite + * + * @param <E> FIXME */ class MatrixMapFixed<E> extends AbstractMatrixMap<E> { - /** Logger. */ + /** + * Logger. + */ static private Log log = LogFactory.getLog(MatrixMapFixed.class); protected Matrix<E> matrix = null; @@ -828,7 +834,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Modifie un element de la matrice en fonction des dimensions passé en * paramètre.<br> - * + * <p> * Exemple: Si on a un matrice 3D.<br> * m.set(v, [1,1,1]) modifie un element de la matrice.<br> * @@ -864,8 +870,8 @@ public interface MatrixMap<E> extends Iterable<E> { origin0 = origin0 && origin[i] == 0; } if (origin0 - && mat instanceof MatrixMapFixed - && Arrays.equals(mat.getDim(), this.getDim())) { + && mat instanceof MatrixMapFixed + && Arrays.equals(mat.getDim(), this.getDim())) { getMatrix().data.paste(((MatrixMapFixed<E>) mat).getMatrix().data); } else { super.paste(origin, mat); @@ -880,11 +886,13 @@ public interface MatrixMap<E> extends Iterable<E> { * Classe abstraite permettant de facilement implanter les matrice fixe, * elastique et submatrix * - * @param <E> + * @param <E> FIXME */ abstract class AbstractMatrixMap<E> implements MatrixMap<E> { - /** Logger. */ + /** + * Logger. + */ static private Log log = LogFactory.getLog(AbstractMatrixMap.class); protected String name = null; @@ -967,9 +975,6 @@ public interface MatrixMap<E> extends Iterable<E> { return result; } - /* - * @see java.lang.Object#clone() - */ @Override public MatrixMap clone() { return copy(); @@ -1079,7 +1084,7 @@ public interface MatrixMap<E> extends Iterable<E> { result = ObjectUtils.equals(dimName1, dimName2); if (log.isTraceEnabled()) { log.trace("dimName1(" + dimName1 + ")==dimName2(" + dimName2 - + ")=" + result); + + ")=" + result); } // System.out.println("dimName1("+dimName1+")==dimName2("+dimName2+ // ")="+result); @@ -1104,7 +1109,7 @@ public interface MatrixMap<E> extends Iterable<E> { * Verifie si les matrices sont egales en ne regardant que les valeurs et * pas les semantiques * - * @param mat + * @param mat FIXME * @return equality on values */ public boolean equalsValues(MatrixMap mat) { @@ -1133,7 +1138,7 @@ public interface MatrixMap<E> extends Iterable<E> { * v1, v2, v3 * ] * </pre> - * + * <p> * Si la matrice est 2D * <pre> * MaMatrice(matrix2D) [ @@ -1144,11 +1149,11 @@ public interface MatrixMap<E> extends Iterable<E> { * DimC v7, v8, v9 * ] * </pre> - * + * <p> * Pour les autres types de matrice la methode {@link #toStringGeneric() } * est utilise * - * @return + * @return FIXME */ @Override public String toString() { @@ -1208,7 +1213,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Representation string de la matrice quelque soit le nombre de dimension * - * @return + * @return FIXME */ public String toStringGeneric() { StringBuilder result = new StringBuilder(); @@ -1339,8 +1344,8 @@ public interface MatrixMap<E> extends Iterable<E> { * Add to desambiguas some call with xpath engine, but do the same thing * {@link #getSubMatrix(int, Object[])} * - * @param dim - * @param elem + * @param dim FIXME + * @param elem FIXME * @return new matrix */ public MatrixMap<E> getSubMatrixOnSemantic(int dim, Object... elem) { @@ -1367,7 +1372,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Permet de prendre une sous matrice dans la matrice courante. - * + * <p> * Réalise plusieurs appels à {@link #getSubMatrix(int, Object...)} suivant * l'implémentation. * @@ -1380,7 +1385,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (elems.length != dim.length) { throw new IllegalArgumentException(String.format( "Can't get sub matrix with different dimension count " - + "(expected: %d, got %d)", dim.length, elems.length)); + + "(expected: %d, got %d)", dim.length, elems.length)); } MatrixMap<E> result = this; @@ -1407,7 +1412,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Permet de prendre une sous matrice dans la matrice courante. - * + * <p> * Réalise plusieurs appels a {@link #getSubMatrix(int, int[])} suivant * l'implementation. * @@ -1420,7 +1425,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (elems.length != dim.length) { throw new IllegalArgumentException(String.format( "Can't get sub matrix with different dimension count " - + "(expected: %d, got %d)", dim.length, elems.length)); + + "(expected: %d, got %d)", dim.length, elems.length)); } MatrixMap<E> result = this; @@ -1438,7 +1443,7 @@ public interface MatrixMap<E> extends Iterable<E> { * seule dimension à un seul élément. * * @return une nouvelle matrice plus petite que la matrice actuelle ou egal - * s'il n'y a aucune dimension à supprimer + * s'il n'y a aucune dimension à supprimer */ public MatrixMap<E> reduce() { return reduce(1); @@ -1470,7 +1475,7 @@ public interface MatrixMap<E> extends Iterable<E> { // si la dimension à plus d'un élément ou qu'il n'est pas dans dims // on garde la dimension if (getDim(j) > 1 || Arrays.binarySearch(dims, j) < 0 - || j < minNbDim) { + || j < minNbDim) { // on ne conserve que les dimensions supérieure à 1 correspondance[sem.size()] = j; sem.add(getSemantic(j)); @@ -1490,7 +1495,7 @@ public interface MatrixMap<E> extends Iterable<E> { * @param minNbDim le nombre minimum de dimension que l'on souhaite pour la * matrice résultat * @return une nouvelle matrice plus petite que la matrice actuelle ou egal - * s'il n'y a aucune dimension à supprimer + * s'il n'y a aucune dimension à supprimer */ public MatrixMap<E> reduce(int minNbDim) { // tableau permettant de faire la correspondance entre les dimensions @@ -1597,7 +1602,7 @@ public interface MatrixMap<E> extends Iterable<E> { * Pour l'instant une sous matrice a obligatoirement le meme nombre de dimension * que la matrice qu'elle contient. Elle permet juste de reduire le nombre * d'element d'une dimension. - * + * <p> * C'est comme une "vue" réduite sur la vraie matrices. */ class SubMatrix<E> extends AbstractMatrixMap<E> { // SubMatrix @@ -1715,10 +1720,14 @@ public interface MatrixMap<E> extends Iterable<E> { int[] convertCoordinates(int[] coordinates); } - /** La conversion est juste un decalage d'indice */ + /** + * La conversion est juste un decalage d'indice + */ protected static class ShiftConverter implements DimensionConverter { - /** serialVersionUID. */ + /** + * serialVersionUID. + */ private static final long serialVersionUID = 1L; protected int dim; @@ -1748,10 +1757,14 @@ public interface MatrixMap<E> extends Iterable<E> { } } - /** La conversion est le mapping d'un element vers un autre element. */ + /** + * La conversion est le mapping d'un element vers un autre element. + */ protected static class MappingConverter implements DimensionConverter { - /** serialVersionUID. */ + /** + * serialVersionUID. + */ private static final long serialVersionUID = -6367416559713556559L; protected int dim; @@ -1784,13 +1797,19 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Objet matrice qui ne permet que le stockage avec des positions int * dans une matrice a autant de dimension que l'on souhaite. + * + * @param <E> FIXME */ class Matrix<E> implements Iterable<E> { // BasicMatrix - /** Les dimensions de la matrice */ + /** + * Les dimensions de la matrice + */ protected int[] dimensions = null; - /** La matrice en représentation linéaire */ + /** + * La matrice en représentation linéaire + */ protected Vector<E> data = null; /** @@ -1881,6 +1900,7 @@ public interface MatrixMap<E> extends Iterable<E> { * * @return un objet Inc pret à être utilisé */ + @Override public MatrixIterator<E> iterator() { return new MatrixIterator<E>(this); } @@ -1973,7 +1993,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (!result) { throw new NoSuchElementException(String.format( "Invalid element asked %s for real dimension %s", Arrays.toString(pos), Arrays - .toString(dim))); + .toString(dim))); } } @@ -2021,7 +2041,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (o instanceof Matrix) { Matrix other = (Matrix) o; return this == o - || (Arrays.equals(this.dimensions, other.dimensions) && this.data + || (Arrays.equals(this.dimensions, other.dimensions) && this.data .equals(other.data)); } return false; @@ -2035,7 +2055,9 @@ public interface MatrixMap<E> extends Iterable<E> { protected int pos = -1; - /** @param matrix la matrice sur lequel l'iterator doit travailler */ + /** + * @param matrix la matrice sur lequel l'iterator doit travailler + */ public MatrixIterator(Matrix<E> matrix) { this.matrix = matrix; pos = -1; @@ -2081,21 +2103,31 @@ public interface MatrixMap<E> extends Iterable<E> { * Cette classe ne gére que les données lineaire. L'avantage de cette classe est * de ne conserver que les elements differents de la valeur par defaut, ce qui * minimize la taille du tableau necessaire a conserver les données. + * + * @param <E> FIXME */ class Vector<E> { // Vector - /** maximum number of element, maximum pos value */ + /** + * maximum number of element, maximum pos value + */ protected int capacity = 0; - /** la valeur par defaut */ + /** + * la valeur par defaut + */ protected E defaultValue = null; - /** contient la position de l'element, le tableau est trie */ + /** + * contient la position de l'element, le tableau est trie + */ protected int[] position; protected int positionSize = 0; - /** contient la valeur de l'element */ + /** + * contient la valeur de l'element + */ protected ArrayList<E> data = new ArrayList<E>(); public Vector(int capacity) { @@ -2170,7 +2202,7 @@ public interface MatrixMap<E> extends Iterable<E> { protected void checkPos(int pos) { if (pos < 0 || pos >= capacity) { throw new IllegalArgumentException("pos " + pos + " is not in [0, " - + capacity + "]"); + + capacity + "]"); } } @@ -2215,7 +2247,7 @@ public interface MatrixMap<E> extends Iterable<E> { if (o instanceof Vector) { Vector other = (Vector) o; result = Arrays.equals(this.position, other.position) - && data.equals(other.data); + && data.equals(other.data); } return result; } @@ -2223,9 +2255,9 @@ public interface MatrixMap<E> extends Iterable<E> { /** * retourne la position dans le tableau position de la position lineaire * - * @param pos + * @param pos FIXME * @return la position ou < 0 donnant la position de l'element s'il etait - * present + * present */ protected int findIndex(int pos) { return Arrays.binarySearch(position, pos); @@ -2265,6 +2297,7 @@ public interface MatrixMap<E> extends Iterable<E> { /** * On recopie tous les attributs pour que le vector ressemble exactement a * celui passé en argument + * @param v FIXME */ public void paste(Vector<E> v) { this.capacity = v.capacity; @@ -2272,12 +2305,15 @@ public interface MatrixMap<E> extends Iterable<E> { this.positionSize = v.positionSize; this.position = new int[v.position.length]; System.arraycopy(v.position, 0, this.position, 0, - this.position.length); + this.position.length); this.data.clear(); this.data.addAll(v.data); } - /** on applique sur chaque donnée existante et sur default */ + /** + * on applique sur chaque donnée existante et sur default + * @param f FIXME + */ public void map(MapFunction<E> f) { // on commence toujours par modifier la valeur par defaut // car les valeurs suivante pourrait prendre cette valeur @@ -2301,6 +2337,8 @@ public interface MatrixMap<E> extends Iterable<E> { /** * Permet de faire un traitement sur des valeurs et d'en retourner * des nouvelles. + * + * @param <E> FIXME */ interface MapFunction<E> { // MapFunction @@ -2310,7 +2348,7 @@ public interface MatrixMap<E> extends Iterable<E> { * * @param value la valeur courante sur lequel il faut faire le traitement * @return la nouvelle valeur à mettre dans la matrice à la place de - * l'ancienne. + * l'ancienne. */ E apply(E value); diff --git a/src/main/java/org/nuiton/util/ObjectUtil.java b/src/main/java/org/nuiton/util/ObjectUtil.java index 47ff77d..f7fc15b 100644 --- a/src/main/java/org/nuiton/util/ObjectUtil.java +++ b/src/main/java/org/nuiton/util/ObjectUtil.java @@ -97,6 +97,7 @@ public class ObjectUtil { // ObjectUtil * Invoke constructor on clazz to create new instance. Try to find argument * for constructor in args parameter. * + * @param <E> FIXME * @param clazz class of object to instanciate * @param args all possible parameter that constructor can used * @param nullIfMissing if no suitable class or object found in args, @@ -197,13 +198,13 @@ public class ObjectUtil { // ObjectUtil * <li> name="my string with , in string"</li> * <li> name='my string with , in string'</li> * </ul> - * @param classnameAndProperties - * @return the instanciated object - * @throws ClassNotFoundException - * @throws IllegalAccessException - * @throws InstantiationException - * @throws NoSuchMethodException - * @throws InvocationTargetException + * @param classnameAndProperties FIXME + * @return the instanciated object FIXME + * @throws ClassNotFoundException FIXME + * @throws IllegalAccessException FIXME + * @throws InstantiationException FIXME + * @throws NoSuchMethodException FIXME + * @throws InvocationTargetException FIXME */ public static Object create(String classnameAndProperties) throws ClassNotFoundException, @@ -267,6 +268,7 @@ public class ObjectUtil { // ObjectUtil * } * </pre> * + * @param <E> FIXME * @param e object to clone * @return new instance of E * @throws CloneNotSupportedException if some error occur during clone @@ -286,6 +288,7 @@ public class ObjectUtil { // ObjectUtil /** * Use serialization/deserialization to do deep clone of object * + * @param <E> FIXME * @param e object to clone * @return new instance of E * @throws CloneNotSupportedException if some error occur during clone @@ -326,10 +329,10 @@ public class ObjectUtil { // ObjectUtil * @param m method to call * @param params parameters for method call * @return returned method's value - * @throws IllegalAccessException - * @throws IllegalArgumentException - * @throws InvocationTargetException - * @throws InstantiationException + * @throws IllegalAccessException FIXME + * @throws IllegalArgumentException FIXME + * @throws InvocationTargetException FIXME + * @throws InstantiationException FIXME */ public static Object call(Object o, Method m, String... params) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { @@ -460,7 +463,7 @@ public class ObjectUtil { // ObjectUtil * @param clazz class to instanciate * @param params parameters for constructor call * @return new instance of clazz - * @throws IllegalArgumentException + * @throws IllegalArgumentException FIXME */ public static <T> T newInstance(Class<T> clazz, String... params) throws IllegalArgumentException { diff --git a/src/main/java/org/nuiton/util/ResourceException.java b/src/main/java/org/nuiton/util/ResourceException.java index e6b3702..de00c00 100644 --- a/src/main/java/org/nuiton/util/ResourceException.java +++ b/src/main/java/org/nuiton/util/ResourceException.java @@ -35,7 +35,6 @@ package org.nuiton.util; public class ResourceException extends RuntimeException { // ResourceException - /** */ private static final long serialVersionUID = -5490688835958083084L; public ResourceException(String msg) { diff --git a/src/main/java/org/nuiton/util/ResourceNotFoundException.java b/src/main/java/org/nuiton/util/ResourceNotFoundException.java index d68fe4c..fc6487e 100644 --- a/src/main/java/org/nuiton/util/ResourceNotFoundException.java +++ b/src/main/java/org/nuiton/util/ResourceNotFoundException.java @@ -36,7 +36,6 @@ package org.nuiton.util; public class ResourceNotFoundException extends ResourceException { // ResourceNotFoundException - /** */ private static final long serialVersionUID = 623160949107461992L; public ResourceNotFoundException(String msg) { diff --git a/src/main/java/org/nuiton/util/SemVer.java b/src/main/java/org/nuiton/util/SemVer.java index 5c8bdc1..6cf5ea2 100644 --- a/src/main/java/org/nuiton/util/SemVer.java +++ b/src/main/java/org/nuiton/util/SemVer.java @@ -33,26 +33,25 @@ import java.util.regex.Pattern; /** * Implantation de http://semver.org/. - * + * <p> * Cette objet est immutable, Il faut utiliser {@link #getCreator()} * pour modifier un de ses elements - * + * <p> * Quelques changement par rapport au site: * <ul> * <li> le numero de version peut avoir entre 1 et N element, et non pas 3 obligatoirement * <li> on peut avoir un -SNAPSHOT ajoute en toute fin de la version * </ul> - * + * <p> * Un SemVer est en plusieurs elements dont chaque element peut avoir plusieurs * composant. Les composants sont utilise le meme separateur '.'. - * * <ul> - * <li> version: 1 à N composant numerique, les 3 premiers sont nomme - * <ul> - * <li> major - * <li> minor - * <li> patch - * </ul> + * <li> version: 1 à N composant numerique, les 3 premiers sont nomme + * <ul> + * <li> major + * <li> minor + * <li> patch + * </ul> * <li> prerelease: 0 à N composant alphanumerique, le prefix est '-' * <li> build: 0 à N composant alphanumerique, le prefix est '+' * <li> SNAPSHOT: 0 ou 1 composant dont le nom est fixe le prefix est '-' @@ -68,46 +67,63 @@ import java.util.regex.Pattern; * </ul> * * @author Benjamin Poussin - poussin@codelutin.com - * - * * @since 2.6.7 * @deprecated since 3.0 (use now {@link org.nuiton.util.version.SemVer}). */ @Deprecated public class SemVer implements Comparable<SemVer> { - /** Logger. */ + /** + * Logger. + */ static private Log log = LogFactory.getLog(SemVer.class); - /** Separateur utiliser entre chaque element d'une partie */ + /** + * Separateur utiliser entre chaque element d'une partie + */ final static public String SERIES_SEPARATOR = "."; // le separateur - /** Seperateur entre la version et l'element prerelease */ + /** + * Seperateur entre la version et l'element prerelease + */ final static public String PRERELEASE_SEPARATOR = "-"; // le separateur de Prerelease - /** Separateur utiliser devant l'element build */ + /** + * Separateur utiliser devant l'element build + */ final static public String BUILD_SEPARATOR = "+"; // le separateur de build - /** pattern pour une partie de l'element version */ + /** + * pattern pour une partie de l'element version + */ final static public String PATTERN_VERSION = "[0-9]+"; // le version ne sont que des nombres - /** pattern pour une partie de l'element prerelease */ + /** + * pattern pour une partie de l'element prerelease + */ final static public String PATTERN_PRERELEASE = "[0-9A-Za-z-]+"; // les Prerelease sont des chiffre, lettre ou '-' - /** pattern pour une partir de l'element build */ + /** + * pattern pour une partir de l'element build + */ final static public String PATTERN_BUILD = "[0-9A-Za-z-]+";// les Build sont des chiffre, lettre ou '-' - /** Separateur de SNAPSHOT */ + /** + * Separateur de SNAPSHOT + */ final static public String SNAPSHOT_SEPARATOR = "-"; - /** la chaine de caractere representant le SNAPSHOT */ + /** + * la chaine de caractere representant le SNAPSHOT + */ final static public String SNAPSHOT = "SNAPSHOT"; // "(1.20.300)(-alpha-1.20)?(+r123.20130126)?" // version prerelease build - /** pattern qui permet de separer les 3 constituante d'une version, ne + /** + * pattern qui permet de separer les 3 constituante d'une version, ne * supporte pas le SNAPSHOT, il faut donc que le SNAPSHOT ait ete retirer * avant d'appliquer le pattern */ final static Pattern PATTERN_ALL = Pattern.compile( - "("+PATTERN_VERSION+"(?:"+Pattern.quote(SERIES_SEPARATOR)+PATTERN_VERSION+")*)" + - "("+Pattern.quote(PRERELEASE_SEPARATOR)+ PATTERN_PRERELEASE+"(?:"+Pattern.quote(SERIES_SEPARATOR)+PATTERN_PRERELEASE+")*)?" + - "("+Pattern.quote(BUILD_SEPARATOR)+ PATTERN_BUILD+"(?:"+Pattern.quote(SERIES_SEPARATOR)+PATTERN_BUILD+")*)?"); + "(" + PATTERN_VERSION + "(?:" + Pattern.quote(SERIES_SEPARATOR) + PATTERN_VERSION + ")*)" + + "(" + Pattern.quote(PRERELEASE_SEPARATOR) + PATTERN_PRERELEASE + "(?:" + Pattern.quote(SERIES_SEPARATOR) + PATTERN_PRERELEASE + ")*)?" + + "(" + Pattern.quote(BUILD_SEPARATOR) + PATTERN_BUILD + "(?:" + Pattern.quote(SERIES_SEPARATOR) + PATTERN_BUILD + ")*)?"); protected String version; protected String prerelease; @@ -116,8 +132,9 @@ public class SemVer implements Comparable<SemVer> { /** * Create new Version object, strip is done on argument to remove extra space - * @param versionString - * @exception IllegalArgumentException if argument isn't valid version string + * + * @param versionString FIXME + * @throws IllegalArgumentException if argument isn't valid version string */ public SemVer(String versionString) { String v = StringUtils.strip(versionString); // on conserve versionString intact pour le message d'erreur @@ -171,10 +188,11 @@ public class SemVer implements Comparable<SemVer> { /** * Compare deux elements de meme semantique (version, prerelease, build, snapshot) * sinon le comportement est non predictible - * @param a - * @param b + * + * @param a FIXME + * @param b FIXME * @param nullIsHigh indique si un des elements est null, s'il est plus - * grand ou plus petit que l'autre + * grand ou plus petit que l'autre * @return negatif si a inferieur b, 0 si a == b, positif si a superieur a b */ protected int compare(String a, String b, boolean nullIsHigh) { @@ -191,7 +209,7 @@ public class SemVer implements Comparable<SemVer> { String[] bSeries = StringUtils.split(b, SERIES_SEPARATOR); int length = Math.max(aSeries.length, bSeries.length); - for (int i=0; result==0 & i<length; i++) { + for (int i = 0; result == 0 & i < length; i++) { // s'il y en a un qui est plus court, on prend par defaut "" String va = i < aSeries.length ? aSeries[i] : ""; String vb = i < bSeries.length ? bSeries[i] : ""; @@ -217,12 +235,12 @@ public class SemVer implements Comparable<SemVer> { /** * Ne compare par le chaine, seulement la nullite, si un des arguments * est null, alors il est plus grand que l'autre. - * + * <p> * 1.0 est plus grand que 1.0-Beta * - * @param a - * @param b - * @return + * @param a FIXME + * @param b FIXME + * @return FIXME */ protected int nullIsHigh(String a, String b) { int result = 0; @@ -239,12 +257,12 @@ public class SemVer implements Comparable<SemVer> { /** * Ne compare par le chaine, seulement la nullite, si un des arguments * est null, alors il est plus petit que l'autre. - * + * <p> * 1.0+r123 est plus grand que 1.0 * - * @param a - * @param b - * @return + * @param a FIXME + * @param b FIXME + * @return FIXME */ protected int nullIsLow(String a, String b) { int result = 0; @@ -265,7 +283,8 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2 * </ul> * - * @return + * @param element FIXME + * @return FIXME */ protected int getComposantCount(String element) { int result = 0; @@ -277,8 +296,10 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * + * @param element FIXME + * @param i FIXME + * @return FIXME */ protected String getComposant(String element, int i) { String[] v = StringUtils.split(element, SERIES_SEPARATOR); @@ -290,7 +311,6 @@ public class SemVer implements Comparable<SemVer> { } - public String getVersion() { return version; } @@ -302,7 +322,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2 * </ul> * - * @return + * @return FIXME */ public int getVersionCount() { int result = getComposantCount(getVersion()); @@ -311,8 +331,9 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * + * @param i FIXME + * @return FIXME */ public String getVersion(int i) { String s = getComposant(getVersion(), i); @@ -345,7 +366,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2 * </ul> * - * @return + * @return FIXME */ public int getPrereleaseCount() { int result = getComposantCount(getPrerelease()); @@ -354,8 +375,9 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * + * @param i FIXME + * @return FIXME */ public String getPrerelease(int i) { String s = getComposant(getPrerelease(), i); @@ -373,7 +395,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2 * </ul> * - * @return + * @return FIXME */ public int getBuildCount() { int result = getComposantCount(getBuild()); @@ -382,8 +404,9 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * + * @param i FIXME + * @return FIXME */ public String getBuild(int i) { String s = getComposant(getBuild(), i); @@ -408,7 +431,7 @@ public class SemVer implements Comparable<SemVer> { @Override public boolean equals(Object o) { - boolean result = o instanceof SemVer && this.compareTo((SemVer)o) == 0; + boolean result = o instanceof SemVer && this.compareTo((SemVer) o) == 0; return result; } @@ -443,7 +466,8 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un objet creator initialise avec les donnees de ce SemVer * ce qui permet de creer un nouveau SemVer en modifiant un des elements - * @return + * + * @return FIXME */ public SemVerCreator getCreator() { return creator(this); @@ -451,8 +475,9 @@ public class SemVer implements Comparable<SemVer> { /** * Indique si la chaine represente bien une version au format SemVer - * @param version - * @return + * + * @param version FIXME + * @return FIXME */ static public boolean isSemVer(String version) { if (StringUtils.endsWithIgnoreCase(version, SNAPSHOT)) { @@ -470,9 +495,11 @@ public class SemVer implements Comparable<SemVer> { * SemVer v = SemVer.creator().setVersion("1.2").setPrerelease("beta.1").setBuild("r123").done(); * SemVer v = SemVer.creator("1.2", "beta.1","r123", SemVer.SNAPSHOT).done(); * </pre> - * @return + * + * @param v FIXME + * @return FIXME */ - static public SemVerCreator creator(String ... v) { + static public SemVerCreator creator(String... v) { SemVerCreator result = new SemVerCreator(); if (v != null) { if (v.length > 0) { @@ -507,10 +534,11 @@ public class SemVer implements Comparable<SemVer> { /** * Createur qui permet de passer en parametre les different composante de * l'element version - * @param v - * @return + * + * @param v FIXME + * @return FIXME */ - static public SemVerCreator creator(int ... v) { + static public SemVerCreator creator(int... v) { SemVerCreator result = creator(StringUtils.join(v, SERIES_SEPARATOR)); return result; } @@ -518,11 +546,11 @@ public class SemVer implements Comparable<SemVer> { /** * Create creator initialized with SemVer value, you can change some Element * by puting null value. - * + * <p> * SemVer n = SemVer.creator(v).setBuild("r123").setSnapshot(false).done(); * - * @param v - * @return + * @param v FIXME + * @return FIXME */ static public SemVerCreator creator(SemVer v) { SemVerCreator result = creator( @@ -535,7 +563,7 @@ public class SemVer implements Comparable<SemVer> { * aussi de desambiguise les deux autres methode creator qui si elle * n'ont pas de parametre sont semblable * - * @return + * @return FIXME */ static public SemVerCreator creator() { SemVerCreator result = new SemVerCreator(); @@ -587,7 +615,7 @@ public class SemVer implements Comparable<SemVer> { * doit representer un entier sinon une exception est leve * * @param indice la composante de la version a incrementer - * @param inc le nombre a lui ajouter + * @param inc le nombre a lui ajouter * @return new instance, this SemVer is not modified */ public SemVerCreator incVersion(int indice, int inc) { @@ -609,6 +637,7 @@ public class SemVer implements Comparable<SemVer> { /** * Return new instance, this SemVer is not modified + * * @return new instance where major version number is incremented by 1 */ public SemVerCreator incMajor() { @@ -617,6 +646,7 @@ public class SemVer implements Comparable<SemVer> { /** * Return new instance, this SemVer is not modified + * * @return new instance where major version number is incremented by 1 */ public SemVerCreator incMinor() { @@ -625,6 +655,7 @@ public class SemVer implements Comparable<SemVer> { /** * Return new instance, this SemVer is not modified + * * @return new instance where major version number is incremented by 1 */ public SemVerCreator incPatch() { @@ -634,10 +665,10 @@ public class SemVer implements Comparable<SemVer> { public SemVer done() { SemVer result = new SemVer( StringUtils.defaultString(version) + - ifNotNull(PRERELEASE_SEPARATOR, prerelease) + - ifNotNull(BUILD_SEPARATOR, build) + - ifNotNull(SNAPSHOT_SEPARATOR, snapshot) - ); + ifNotNull(PRERELEASE_SEPARATOR, prerelease) + + ifNotNull(BUILD_SEPARATOR, build) + + ifNotNull(SNAPSHOT_SEPARATOR, snapshot) + ); return result; } } diff --git a/src/main/java/org/nuiton/util/StringUtil.java b/src/main/java/org/nuiton/util/StringUtil.java index 458eebc..336db40 100644 --- a/src/main/java/org/nuiton/util/StringUtil.java +++ b/src/main/java/org/nuiton/util/StringUtil.java @@ -498,7 +498,7 @@ public class StringUtil { // StringUtil * "yellow" ou bien en RGB "#FFAA99", et avec un canal alpha * "#FFAA3366" * @return la couleur demandé si possible sinon null - * @throws IllegalArgumentException + * @throws IllegalArgumentException FIXME * @throws StringUtilException if any problem while conversion */ public static Color toColor(String s) throws StringUtilException { diff --git a/src/main/java/org/nuiton/util/StringUtilException.java b/src/main/java/org/nuiton/util/StringUtilException.java index 873ec57..c9e30cd 100644 --- a/src/main/java/org/nuiton/util/StringUtilException.java +++ b/src/main/java/org/nuiton/util/StringUtilException.java @@ -25,7 +25,6 @@ package org.nuiton.util; /** @author pineau */ public class StringUtilException extends RuntimeException { - /** */ private static final long serialVersionUID = 6148795384335489591L; public StringUtilException(String message, Exception e) { diff --git a/src/main/java/org/nuiton/util/ZipUtil.java b/src/main/java/org/nuiton/util/ZipUtil.java index e081563..727d0f8 100644 --- a/src/main/java/org/nuiton/util/ZipUtil.java +++ b/src/main/java/org/nuiton/util/ZipUtil.java @@ -518,7 +518,7 @@ public class ZipUtil { * @param file archive file * @param targetDir destination file * @param excludes excludes pattern (pattern must match complete entry name including root folder) - * @throws IOException + * @throws IOException FIXME */ public static void uncompressFiltred(File file, File targetDir, diff --git a/src/main/java/org/nuiton/util/beans/BeanUtil.java b/src/main/java/org/nuiton/util/beans/BeanUtil.java index 10fc39f..01c9949 100644 --- a/src/main/java/org/nuiton/util/beans/BeanUtil.java +++ b/src/main/java/org/nuiton/util/beans/BeanUtil.java @@ -210,6 +210,7 @@ public class BeanUtil { * Obtains all readable properties from a given type. * * @param beanType the type to seek + * @param propertyName FIXME * @return the set of all readable properties for the given type * @since 2.0 */ diff --git a/src/main/java/org/nuiton/util/beans/Binder.java b/src/main/java/org/nuiton/util/beans/Binder.java index 23a979e..b94131a 100644 --- a/src/main/java/org/nuiton/util/beans/Binder.java +++ b/src/main/java/org/nuiton/util/beans/Binder.java @@ -114,7 +114,7 @@ public class Binder<I, O> implements Serializable { * To bind the collection. * * <strong>Warning:</strong> Do not use it in the method {@link BinderModelBuilder#addCollectionStrategy(CollectionStrategy, String...)} - * since it is only use in internaly by the method {@link BinderModelBuilder#addCollectionBinder(Binder, String...)}. + * since it is only use in internaly by the method {@link BinderModelBuilder#addCollectionBinder(Binder, String...)} * * Note: at this level, we will just create the collection. */ diff --git a/src/main/java/org/nuiton/util/beans/BinderFactory.java b/src/main/java/org/nuiton/util/beans/BinderFactory.java index e2704ce..42f6144 100644 --- a/src/main/java/org/nuiton/util/beans/BinderFactory.java +++ b/src/main/java/org/nuiton/util/beans/BinderFactory.java @@ -134,6 +134,7 @@ public class BinderFactory { * @param binderType type of binder required * @param <S> the type of source * @param <T> the type of target + * @param <B> the type of binder * @return the new instanciated binder. */ public static <S, T, B extends Binder<S, T>> B newBinder(Class<S> sourceType, @@ -306,6 +307,7 @@ public class BinderFactory { * @param binderType type of binder required * @param <S> the type of source * @param <T> the type of target + * @param <B> the type of binder * @return the new instanciated binder. */ protected static <S, T, B extends Binder<S, T>> Binder<S, T> newBinder0(Class<S> sourceType, diff --git a/src/main/java/org/nuiton/util/beans/BinderModelBuilder.java b/src/main/java/org/nuiton/util/beans/BinderModelBuilder.java index dcb9d39..e0b068a 100644 --- a/src/main/java/org/nuiton/util/beans/BinderModelBuilder.java +++ b/src/main/java/org/nuiton/util/beans/BinderModelBuilder.java @@ -38,16 +38,15 @@ import java.util.TreeMap; /** * Class to create a new {@link Binder.BinderModel}. - * - * + * <p> * A such object is designed to build only one model of binder and can not be * used directly to create a new binder, it prepares only the model of a new * binder, which after must be registred in the {@link BinderFactory} to obtain * a real {@link Binder}. - * + * <p> * If you want to create more than one binder model, use each time a new * binder builder. - * + * <p> * To obtain a new instance of a build please use one of the factories method : * <ul> * <li>{@link #newEmptyBuilder(Class)}} to create a binder model with same @@ -84,7 +83,6 @@ import java.util.TreeMap; * <pre> * builder.addSimpleProperties(...).addProperty(...).addBinder(...) * </pre> - * * Here is an example of how to use the {@link BinderModelBuilder} : * <pre> * BinderModelBuilder<Bean, Bean> builder = new BinderModelBuilder(Bean.class); @@ -92,13 +90,14 @@ import java.util.TreeMap; * BinderFactory.registerBinderModel(builder); * Binder<Bean, Bean> binder = BinderFactory.getBinder(BeanA.class); * </pre> - * * Once the binder is registred into the {@link BinderFactory}, you can get it * each time you need it : * <pre> * Binder<Bean, Bean> binder = BinderFactory.getBinder(Bean.class); * </pre> * + * @param <S> FIXME + * @param <T> FIXME * @author Tony Chemit - chemit@codelutin.com * @see Binder.BinderModel * @see Binder @@ -111,18 +110,25 @@ public class BinderModelBuilder<S, T> { */ protected boolean canTypeMismatch; - /** current model used to build the binder */ + /** + * current model used to build the binder + */ protected Binder.BinderModel<S, T> model; - /** source properties descriptors */ + /** + * source properties descriptors + */ protected Map<String, PropertyDescriptor> sourceDescriptors; - /** target properties descriptors */ + /** + * target properties descriptors + */ protected Map<String, PropertyDescriptor> targetDescriptors; /** * Creates a new mirrored and empty model binder for the given {@code type}. * + * @param <S> FIXME * @param type the type of mirrored binder * @return the new instanciated builder */ @@ -133,6 +139,8 @@ public class BinderModelBuilder<S, T> { /** * Creates a new empty model binder for the given types. * + * @param <S> FIXME + * @param <T> FIXME * @param sourceType type of the source of the binder * @param targetType type of the target of the binder * @return the new instanciated builder @@ -146,6 +154,7 @@ public class BinderModelBuilder<S, T> { * Creates a new mirrored model builder and fill the model with all matching * and available property from the given type. * + * @param <S> FIXME * @param sourceType the mirrored type of the binder model to create * @param <S> the mirrored type of the binder model to create * @return the new instanciated model builder fully filled @@ -244,7 +253,7 @@ public class BinderModelBuilder<S, T> { return this; } - public <K,V> BinderModelBuilder<S, T> addFunction(Class<K> type, Function<K,V> function) { + public <K, V> BinderModelBuilder<S, T> addFunction(Class<K> type, Function<K, V> function) { model.functions.put(type, function); return this; } @@ -252,7 +261,7 @@ public class BinderModelBuilder<S, T> { /** * Convinient method to create directly a {@link Binder} using the * underlying {@link #model} the builder contains. - * + * <p> * <strong>Note:</strong> Using this method will not make reusable the model * via the {@link BinderFactory}. * @@ -268,7 +277,7 @@ public class BinderModelBuilder<S, T> { /** * Convinient method to create directly a {@link Binder} using the * underlying {@link #model} the builder contains. - * + * <p> * <strong>Note:</strong> Using this method will not make reusable the model * via the {@link BinderFactory}. * @@ -285,15 +294,15 @@ public class BinderModelBuilder<S, T> { /** * set factory of target instance + * @param instanceFactory FIXME */ public void setInstanceFactory(InstanceFactory<T> instanceFactory) { model.setInstanceFactory(instanceFactory); } /** - * Add to the binder model some simple properties (says source property name - * = target property name). - * + * Add to the binder model some simple properties (says source property name = target property name). + * <p> * <b>Note:</b> If no model is present, the method will fail. * * @param properties the name of mirrored property @@ -314,9 +323,8 @@ public class BinderModelBuilder<S, T> { } /** - * Add to the binder model some simple properties (says source property name - * = target property name). - * + * Add to the binder model some simple properties (says source property name = target property name). + * <p> * <b>Note:</b> If no model is present, the method will fail. * * @param sourceProperty the name of the source property to bind @@ -343,15 +351,15 @@ public class BinderModelBuilder<S, T> { /** * Add to the binder model some properties. - * + * <p> * Parameter {@code sourceAndTargetProperties} must be a array of couple * of {@code sourceProperty}, {@code targetProperty}. - * + * <p> * Example : * <pre> * builder.addProperties("name","name2","text","text"); * </pre> - * + * <p> * <b>Note:</b> If no model is present, the method will fail. * * @param sourceAndTargetProperties the couple of (sourceProperty - @@ -368,7 +376,7 @@ public class BinderModelBuilder<S, T> { if (sourceAndTargetProperties.length % 2 != 0) { throw new IllegalArgumentException( "must have couple(s) of sourceProperty,targetProperty) " + - "but had " + Arrays.toString(sourceAndTargetProperties)); + "but had " + Arrays.toString(sourceAndTargetProperties)); } for (int i = 0, max = sourceAndTargetProperties.length / 2; i < max; i++) { @@ -377,12 +385,12 @@ public class BinderModelBuilder<S, T> { if (sourceProperty == null) { throw new NullPointerException( "parameter 'sourceAndTargetProperties' can not " + - "contains a null value"); + "contains a null value"); } if (targetProperty == null) { throw new NullPointerException( "parameter 'sourceAndTargetProperties' can not " + - "contains a null value"); + "contains a null value"); } addProperty0(sourceProperty, targetProperty); } @@ -400,7 +408,7 @@ public class BinderModelBuilder<S, T> { if (!model.containsSourceProperty(propertyName)) { throw new IllegalArgumentException( "source property '" + propertyName + "' " + - " is NOT registred."); + " is NOT registred."); } // check property is the same type of given binder @@ -408,11 +416,11 @@ public class BinderModelBuilder<S, T> { Class<?> type = descriptor.getPropertyType(); if (!Collection.class.isAssignableFrom(type) && - !binder.model.getSourceType().isAssignableFrom(type)) { + !binder.model.getSourceType().isAssignableFrom(type)) { throw new IllegalStateException( "source property '" + propertyName + - "' has not the same type [" + type + - "] of the binder [" + binder.model.getSourceType() + "]."); + "' has not the same type [" + type + + "] of the binder [" + binder.model.getSourceType() + "]."); } // can safely add the strategy @@ -455,9 +463,9 @@ public class BinderModelBuilder<S, T> { /** * Creates a new model builder inversing the the source and target of this builder. - * + * <p> * the result build will contains the inversed properties mapping of the original builder. - * + * <p> * Other builder attributes are not used used * * @return the new model builder @@ -475,7 +483,7 @@ public class BinderModelBuilder<S, T> { return builder; } - + protected BinderModelBuilder<S, T> addCollectionStrategy0(String propertyName, Binder.CollectionStrategy strategy, Binder binder) { @@ -484,7 +492,7 @@ public class BinderModelBuilder<S, T> { if (!model.containsSourceProperty(propertyName)) { throw new IllegalArgumentException( "source property '" + propertyName + "' " + - " is NOT registred."); + " is NOT registred."); } // check property is collection type @@ -493,13 +501,13 @@ public class BinderModelBuilder<S, T> { if (!Collection.class.isAssignableFrom(type)) { throw new IllegalStateException( "source property '" + propertyName + - "' is not a collection type [" + type + "]"); + "' is not a collection type [" + type + "]"); } // can safely add the strategy model.addCollectionStrategy(propertyName, strategy); - if (binder!=null) { + if (binder != null) { // add also the binder model.addBinder(propertyName, binder); @@ -525,7 +533,7 @@ public class BinderModelBuilder<S, T> { if (model != null) { throw new IllegalStateException( "there is already a binderModel in construction, release " + - "it with the method createBinder before using this method." + "it with the method createBinder before using this method." ); } @@ -550,14 +558,14 @@ public class BinderModelBuilder<S, T> { sourceDescriptors.get(sourceProperty); if (sourceDescriptor == null) { throw new IllegalArgumentException("no property '" + - sourceProperty + "' " + "found on type " + - model.getSourceType()); + sourceProperty + "' " + "found on type " + + model.getSourceType()); } // check srcProperty is readable Method readMethod = sourceDescriptor.getReadMethod(); if (readMethod == null) { throw new IllegalArgumentException("property '" + sourceProperty + - "' " + "is not readable on type " + model.getSourceType()); + "' " + "is not readable on type " + model.getSourceType()); } // obtain dst descriptor @@ -565,14 +573,14 @@ public class BinderModelBuilder<S, T> { targetDescriptors.get(targetProperty); if (targetDescriptor == null) { throw new IllegalArgumentException("no property '" + - targetProperty + "' " + "found on type " + - model.getTargetType()); + targetProperty + "' " + "found on type " + + model.getTargetType()); } // check dstProperty is writable Method writeMethod = targetDescriptor.getWriteMethod(); if (writeMethod == null) { throw new IllegalArgumentException("property '" + targetProperty + - "' " + "is not writable on type " + model.getTargetType()); + "' " + "is not writable on type " + model.getTargetType()); } // check types are ok @@ -581,9 +589,9 @@ public class BinderModelBuilder<S, T> { //TODO-TC20100221 : should check if primitive and boxed it in such case if (!sourceType.equals(targetType) && !canTypeMismatch) { throw new IllegalArgumentException("source property '" + - sourceProperty + "' and target property '" + - targetProperty + "' are not compatible ( sourceType : " + - sourceType + " vs targetType :" + targetType + ')'); + sourceProperty + "' and target property '" + + targetProperty + "' are not compatible ( sourceType : " + + sourceType + " vs targetType :" + targetType + ')'); } // check srcProperty does not exist @@ -599,7 +607,7 @@ public class BinderModelBuilder<S, T> { // property for the entry and this is a bit unatural if (model.containsTargetProperty(targetProperty)) { throw new IllegalArgumentException("destination property '" + - targetProperty + "' " + " was already registred."); + targetProperty + "' " + " was already registred."); } // safe to add the binding model.addBinding(sourceDescriptor, targetDescriptor); @@ -629,7 +637,7 @@ public class BinderModelBuilder<S, T> { } } catch (IntrospectionException e) { throw new RuntimeException("Could not obtain bean properties " + - "descriptors for source type " + type, e); + "descriptors for source type " + type, e); } Class<?>[] interfaces = type.getInterfaces(); for (Class<?> i : interfaces) { diff --git a/src/main/java/org/nuiton/util/converter/FormatConverterFactory.java b/src/main/java/org/nuiton/util/converter/FormatConverterFactory.java index 4bb4118..62442f7 100644 --- a/src/main/java/org/nuiton/util/converter/FormatConverterFactory.java +++ b/src/main/java/org/nuiton/util/converter/FormatConverterFactory.java @@ -105,10 +105,9 @@ public class FormatConverterFactory { // FormatConverterFactory } /** - * @param clazz - * @param format + * @param clazz FIXME + * @param format FIXME * @return retourne null si aucun converter trouvé - * @see #getConverter(Class, Format, FormatConverter) */ public FormatConverter<?> getConverter(Class<?> clazz, Format format) { return getConverter(clazz, format, null); @@ -153,10 +152,9 @@ public class FormatConverterFactory { // FormatConverterFactory } /** - * @param clazz - * @param format + * @param clazz FIXME + * @param format FIXME * @return retourne null si aucun converter trouvé - * @see #findConverter(Class, Format, FormatConverter) */ public FormatConverter<?> findConverter(Class<?> clazz, Format format) { return findConverter(clazz, format, null); diff --git a/src/main/java/org/nuiton/util/converter/FormatMap.java b/src/main/java/org/nuiton/util/converter/FormatMap.java index a4c9282..c16d1b8 100644 --- a/src/main/java/org/nuiton/util/converter/FormatMap.java +++ b/src/main/java/org/nuiton/util/converter/FormatMap.java @@ -94,7 +94,7 @@ public class FormatMap extends HashMap<FormatMap.Format, Object> { // FormatMap * sont oubliées et seront recalculé en fonction de cette nouvelle valeur * * @param format le format a utiliser - * @param value + * @param value FIXME */ public void setValue(Format format, Object value) { clear(); @@ -152,7 +152,7 @@ public class FormatMap extends HashMap<FormatMap.Format, Object> { // FormatMap * Utilise le FormatConverterFactory par defaut pour la conversion * * @param format le format utilise - * @param args + * @param args FIXME * @return l'objet java */ public Object unconvert(Format format, Object... args) { diff --git a/src/main/java/org/nuiton/util/version/SemVer.java b/src/main/java/org/nuiton/util/version/SemVer.java index 2d74a5e..1d70292 100644 --- a/src/main/java/org/nuiton/util/version/SemVer.java +++ b/src/main/java/org/nuiton/util/version/SemVer.java @@ -110,7 +110,7 @@ public class SemVer implements Comparable<SemVer> { /** * Create new Version object, strip is done on argument to remove extra space - * @param versionString + * @param versionString FIXME * @exception IllegalArgumentException if argument isn't valid version string */ public SemVer(String versionString) { @@ -165,8 +165,8 @@ public class SemVer implements Comparable<SemVer> { /** * Compare deux elements de meme semantique (version, prerelease, build, snapshot) * sinon le comportement est non predictible - * @param a - * @param b + * @param a FIXME + * @param b FIXME * @param nullIsHigh indique si un des elements est null, s'il est plus * grand ou plus petit que l'autre * @return negatif si a inferieur b, 0 si a == b, positif si a superieur a b @@ -214,9 +214,9 @@ public class SemVer implements Comparable<SemVer> { * * 1.0 est plus grand que 1.0-Beta * - * @param a - * @param b - * @return + * @param a FIXME + * @param b FIXME + * @return FIXME */ protected int nullIsHigh(String a, String b) { int result = 0; @@ -236,9 +236,9 @@ public class SemVer implements Comparable<SemVer> { * * 1.0+r123 est plus grand que 1.0 * - * @param a - * @param b - * @return + * @param a FIXME + * @param b FIXME + * @return FIXME */ protected int nullIsLow(String a, String b) { int result = 0; @@ -259,7 +259,8 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2</li> * </ul> * - * @return + * @param element FIXME + * @return FIXME */ protected int getComposantCount(String element) { int result = 0; @@ -271,8 +272,9 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * @param element FIXME + * @param i FIXME + * @return FIXME */ protected String getComposant(String element, int i) { String[] v = StringUtils.split(element, SERIES_SEPARATOR); @@ -296,7 +298,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2</li> * </ul> * - * @return + * @return FIXME */ public int getVersionCount() { int result = getComposantCount(getVersion()); @@ -305,8 +307,8 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * @param i FIXME + * @return FIXME */ public String getVersion(int i) { String s = getComposant(getVersion(), i); @@ -339,7 +341,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2</li> * </ul> * - * @return + * @return FIXME */ public int getPrereleaseCount() { int result = getComposantCount(getPrerelease()); @@ -348,8 +350,8 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * @param i FIXME + * @return FIXME */ public String getPrerelease(int i) { String s = getComposant(getPrerelease(), i); @@ -367,7 +369,7 @@ public class SemVer implements Comparable<SemVer> { * <li>99.100 retourne 2</li> * </ul> * - * @return + * @return FIXME */ public int getBuildCount() { int result = getComposantCount(getBuild()); @@ -376,8 +378,8 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un des composants de l'element version - * @param i - * @return + * @param i FIXME + * @return FIXME */ public String getBuild(int i) { String s = getComposant(getBuild(), i); @@ -437,7 +439,7 @@ public class SemVer implements Comparable<SemVer> { /** * Retourne un objet creator initialise avec les donnees de ce SemVer * ce qui permet de creer un nouveau SemVer en modifiant un des elements - * @return + * @return FIXME */ public SemVerCreator getCreator() { return creator(this); @@ -445,8 +447,8 @@ public class SemVer implements Comparable<SemVer> { /** * Indique si la chaine represente bien une version au format SemVer - * @param version - * @return + * @param version FIXME + * @return FIXME */ static public boolean isSemVer(String version) { if (StringUtils.endsWithIgnoreCase(version, SNAPSHOT)) { @@ -464,7 +466,8 @@ public class SemVer implements Comparable<SemVer> { * SemVer v = SemVer.creator().setVersion("1.2").setPrerelease("beta.1").setBuild("r123").done(); * SemVer v = SemVer.creator("1.2", "beta.1","r123", SemVer.SNAPSHOT).done(); * </pre> - * @return + * @param v FIXME + * @return FIXME */ static public SemVerCreator creator(String ... v) { SemVerCreator result = new SemVerCreator(); @@ -501,8 +504,8 @@ public class SemVer implements Comparable<SemVer> { /** * Createur qui permet de passer en parametre les different composante de * l'element version - * @param v - * @return + * @param v FIXME + * @return FIXME */ static public SemVerCreator creator(int ... v) { SemVerCreator result = creator(StringUtils.join(v, SERIES_SEPARATOR)); @@ -515,8 +518,8 @@ public class SemVer implements Comparable<SemVer> { * * SemVer n = SemVer.creator(v).setBuild("r123").setSnapshot(false).done(); * - * @param v - * @return + * @param v FIXME + * @return FIXME */ static public SemVerCreator creator(SemVer v) { SemVerCreator result = creator( @@ -529,7 +532,7 @@ public class SemVer implements Comparable<SemVer> { * aussi de desambiguise les deux autres methode creator qui si elle * n'ont pas de parametre sont semblable * - * @return + * @return FIXME */ static public SemVerCreator creator() { SemVerCreator result = new SemVerCreator(); diff --git a/src/main/java/org/nuiton/util/version/Versions.java b/src/main/java/org/nuiton/util/version/Versions.java index 189a14d..58bf035 100644 --- a/src/main/java/org/nuiton/util/version/Versions.java +++ b/src/main/java/org/nuiton/util/version/Versions.java @@ -29,7 +29,7 @@ import java.util.List; /** * Useful class around {@link Version}. - * + * <p> * Created on 8/23/14. * * @author Tony Chemit - chemit@codelutin.com @@ -164,16 +164,17 @@ public class Versions { /** * Creates a new version from this one incremented. - * + * <p> * If the last componant is a number, then just increments this number; otherwise add a new * number componant with value 1. - * + * <p> * Example: * <ul> * <li>1 → 2</li> * <li>1-a → 1-a.1</li> * </ul> * + * @param version FIXME * @return the incremented version */ public static Version increments(Version version) { @@ -185,16 +186,17 @@ public class Versions { /** * Creates a new version from this one incremented. - * + * <p> * If the last componant is a number, then just increments this number; otherwise add a new * number componant with value 1. - * + * <p> * Example: * <ul> * <li>1 → 2</li> * <li>1-a → 1-a.1</li> * </ul> * + * @param version FIXME * @param componantSeperator the componant separator to use the last componant is a classifier * @return the incremented version */ @@ -230,10 +232,11 @@ public class Versions { /** * Creates a new version from this one with the number componant incremented at the given position. - * + * <p> * <strong>Note:</strong> * Will fail if the componant at the required position is not a number. * + * @param version FIXME * @param componantPosition position of the version componant to increment * @return the incremented version */ @@ -252,10 +255,11 @@ public class Versions { /** * Creates a new version from this one with the number componant decremented at the given position. - * + * <p> * <strong>Note:</strong> * Will fail if the componant at the required position is not a number, or his value is 0. * + * @param version FIXME * @param componantPosition position of the version componant to increment * @return the decremented version */ -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.