Author: tchemit Date: 2011-05-15 13:13:57 +0200 (Sun, 15 May 2011) New Revision: 2143 Url: http://nuiton.org/repositories/revision/nuiton-utils/2143 Log: fix javadocs reformat some codes Added: trunk/nuiton-utils/src/main/java/org/nuiton/util/package-info.java Removed: trunk/nuiton-utils/src/main/java/org/nuiton/util/package.html Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/ApplicationConfig.java trunk/nuiton-utils/src/main/java/org/nuiton/util/LoggingPatternFormatter.java trunk/nuiton-utils/src/main/java/org/nuiton/util/ObjectUtil.java trunk/nuiton-utils/src/main/java/org/nuiton/util/Resource.java trunk/nuiton-utils/src/main/java/org/nuiton/util/ResourceResolver.java trunk/nuiton-utils/src/main/java/org/nuiton/util/StringUtil.java trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/package-info.java trunk/nuiton-utils/src/main/java/org/nuiton/util/converter/FormatMap.java trunk/nuiton-utils/src/main/java/org/nuiton/util/rmi/package-info.java trunk/nuiton-utils/src/test/java/org/nuiton/util/MD5InputStreamTest.java Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/ApplicationConfig.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/ApplicationConfig.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/ApplicationConfig.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -1070,7 +1070,7 @@ hash = value.hashCode(); } - CacheItem cacheItem = cacheOption.get(cacheKey); + CacheItem<?> cacheItem = cacheOption.get(cacheKey); // compute value if value don't exist in cacheOption or // if it's modified since last computation if (cacheItem == null || cacheItem.hash != hash) { @@ -1084,11 +1084,11 @@ list.add(v); } } - cacheItem = new CacheItem(list, hash); + cacheItem = new CacheItem<List<T>>(list, hash); } else { // prefer use our converter method (auto-register more converters) T v = ConverterUtil.convert(clazz, value); - cacheItem = new CacheItem(v, hash); + cacheItem = new CacheItem<T>(v, hash); } // add new item to the cache cacheOption.put(cacheKey, cacheItem); @@ -1104,8 +1104,8 @@ * Help to convert value to list of object. If no option for this key * empty List is returned finaly * - * @param key - * @return + * @param key the key of searched option + * @return value of option list */ public OptionList getOptionAsList(String key) { String value = getOption(key); @@ -1135,12 +1135,17 @@ * * @param key the option's key * @return Properties object loaded with value pointed by file - * @throws java.io.IOException if exception occured on read file + * @throws IOException if exception occured on read file */ public Properties getOptionAsProperties(String key) throws IOException { File file = getOptionAsFile(key); Properties prop = new RecursiveProperties(); - prop.load(new FileReader(file)); + FileReader reader = new FileReader(file); + try { + prop.load(reader); + } finally { + reader.close(); + } return prop; } @@ -2110,7 +2115,10 @@ } protected <T> List<T> convertListOption(Class<T> type) { - List<T> result= (List<T>) config.convertOption(type, key, value, true); + List<T> result= (List<T>) config.convertOption(type, key, + value, + true + ); return result; } /** Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/LoggingPatternFormatter.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/LoggingPatternFormatter.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/LoggingPatternFormatter.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -216,7 +216,7 @@ if (argumentClass == null) throw new LoggingException("Erreur dans le pattern '" + code + "' inconnu"); - Argument argument = null; + Argument argument; try { argument = (Argument) argumentClass.newInstance(); } catch (InstantiationException eee) { Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/ObjectUtil.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/ObjectUtil.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/ObjectUtil.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -98,10 +98,15 @@ * @return new instance * @throws IllegalArgumentException if something is wrong during instanciation */ - static public <E> E newInstance(Class<E> clazz, Collection args, boolean nullIfMissing) { - Constructor<E>[] constructors = (Constructor<E>[])clazz.getConstructors(); + static public <E> E newInstance(Class<E> clazz, + Collection<?> args, + boolean nullIfMissing) { + Constructor<E>[] constructors = + (Constructor<E>[])clazz.getConstructors(); if (constructors.length != 1) { - throw new IllegalArgumentException(_("nuitonutil.error.class.with.more.than.one.constructor", clazz)); + throw new IllegalArgumentException( + _("nuitonutil.error.class.with.more.than.one.constructor", + clazz)); } // copy collection into modifiable list to add new object @@ -127,26 +132,32 @@ } /** - * Permet de matcher un type d'agument attendu clazz parmi un ensemble + * Permet de matcher un type d'argument attendu clazz parmi un ensemble * possible de candidat. Les candidats peuvent etre des classes qu'il faudra * instancier pour satisfaire le type demande. * - * @param clazz - * @param args - * @param nullIfMissing - * @return + * @param clazz le type recherché + * @param args la liste des arguments ou des types + * @param nullIfMissing pour retourner nulle si l'argument n'est pas trouvé + * @return le type d'argument trouvé */ - static protected Object choiceArgument(Class<?> clazz, List args, boolean nullIfMissing) { + static protected Object choiceArgument(Class<?> clazz, + List args, + boolean nullIfMissing) { Object result = null; boolean addResult = false; for (Object o : args) { if (o != null) { - if (o instanceof Class<?> && clazz.isAssignableFrom((Class<?>) o)) { - // cas on l'on trouve une class dans arg qui une fois instancier convient + if (o instanceof Class<?> && + clazz.isAssignableFrom((Class<?>) o)) { + + // cas on l'on trouve une class dans arg qui une fois + // instancier convient result = newInstance((Class<?>) o, args, nullIfMissing); addResult = true; break; } else if (clazz.isInstance(o)) { + // cas on l'on retrouve un objet assignable pour ce type result = o; break; @@ -164,7 +175,8 @@ // si on ne retrouve rien, result est reste a null if (result == null && !nullIfMissing) { throw new IllegalArgumentException(_( - _("nuitonutil.error.unfound.assignable.argument", clazz, args))); + _("nuitonutil.error.unfound.assignable.argument", + clazz, args))); } return result; } @@ -186,11 +198,16 @@ * @throws NoSuchMethodException * @throws InvocationTargetException */ - public static Object create(String classnameAndProperties) throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { + public static Object create(String classnameAndProperties) throws + ClassNotFoundException, + InstantiationException, + IllegalAccessException, + InvocationTargetException, + NoSuchMethodException { int p = classnameAndProperties.indexOf('('); int l = classnameAndProperties.lastIndexOf(')'); String [] properties = null; - String classname = null; + String classname; if (p != -1) { String tmp = classnameAndProperties.substring(p + 1, l); properties = StringUtil.split(tmp, ","); @@ -198,16 +215,19 @@ } else { classname = classnameAndProperties; } - Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(classname); - Object o = clazz.newInstance(); + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + Class<?> clazz = loader.loadClass(classname); + Object o = clazz.getConstructor().newInstance(); if (properties != null) { for (String prop : properties) { int e = prop.indexOf('='); String propName = prop.substring(0, e).trim(); String propValue = prop.substring(e+1).trim(); - if (propValue.charAt(0) == '"' && propValue.charAt(propValue.length()-1) == '"') { + if (propValue.charAt(0) == '"' && + propValue.charAt(propValue.length()-1) == '"') { propValue = propValue.substring(1, propValue.length()-1); - } else if (propValue.charAt(0) == '\'' && propValue.charAt(propValue.length()-1) == '\'') { + } else if (propValue.charAt(0) == '\'' && + propValue.charAt(propValue.length()-1) == '\'') { propValue = propValue.substring(1, propValue.length()-1); } BeanUtils.setProperty(o, propName, propValue); @@ -345,13 +365,16 @@ } /** - * Get all methods with name given in argument without check parameters - * @param clazz + * Get all methods with name given in argument without check parameters. + * + * @param clazz where to search method * @param methodName method name to search * @param ignoreCase if true, ignore difference in method name case * @return list of detected methods */ - public static List<Method> getMethod(Class<?> clazz, String methodName, boolean ignoreCase) { + public static List<Method> getMethod(Class<?> clazz, + String methodName, + boolean ignoreCase) { List<Method> result = new ArrayList<Method>(); Method[] methods = clazz.getMethods(); @@ -369,7 +392,7 @@ int p = constructorWithParams.indexOf('('); int l = constructorWithParams.lastIndexOf(')'); String [] params = null; - String classname = null; + String classname; if (p != -1) { String tmp = constructorWithParams.substring(p + 1, l); params = StringUtil.split(tmp, ","); @@ -381,6 +404,7 @@ Object result = newInstance(clazz, params); return result; } + /** * Create new instance of clazz, call constructor with params as String. * Each param is converted to required type for @@ -419,19 +443,26 @@ } if (c.isVarArgs()) { - Class<?> argClazz = types[last]; // get var args type - argClazz = argClazz.getComponentType(); // get array component type + + // get var args type + Class<?> argClazz = types[last]; + + // get array component type + argClazz = argClazz.getComponentType(); List<Object> tmp = new ArrayList<Object>(); for (int i = last; i < params.length; i++) { String v = params[i]; Object t = convert(v, argClazz); tmp.add(t); } - parameters[last] = tmp.toArray((Object[]) Array.newInstance(argClazz, tmp.size())); + parameters[last] = + tmp.toArray((Object[]) Array.newInstance( + argClazz, tmp.size())); } if (log.isDebugEnabled()) { - log.debug(_("nuitonutil.debug.objectutil.create", clazz, Arrays.toString(parameters))); + log.debug(_("nuitonutil.debug.objectutil.create", + clazz, Arrays.toString(parameters))); } T result = c.newInstance(parameters); @@ -443,7 +474,8 @@ } } } - throw new IllegalArgumentException(_("nuitonutil.debug.objectutil.instantiate", + throw new IllegalArgumentException( + _("nuitonutil.debug.objectutil.instantiate", clazz, Arrays.toString(params))); } @@ -458,12 +490,15 @@ * @return list of constructors */ @SuppressWarnings("unchecked") - public static <T> List<Constructor<T>> getConstructor(Class<T> clazz, int paramNumber) { + public static <T> List<Constructor<T>> getConstructor(Class<T> clazz, + int paramNumber) { List<Constructor<T>> result = new ArrayList<Constructor<T>>(); - Constructor<T>[] constructors = (Constructor<T>[])clazz.getConstructors(); + Constructor<T>[] constructors = + (Constructor<T>[])clazz.getConstructors(); for (Constructor<T> c : constructors) { if (paramNumber < 0 || - c.isVarArgs() && c.getParameterTypes().length <= paramNumber - 1 || + c.isVarArgs() && + c.getParameterTypes().length <= paramNumber - 1 || c.getParameterTypes().length == paramNumber) { result.add(c); } Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/Resource.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/Resource.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/Resource.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -66,7 +66,7 @@ * Created: 5 août 2003 * * @author bpoussin <poussin@codelutin.com> - * $Id$ + * $Id$ */ public class Resource { // Resource @@ -98,7 +98,7 @@ public static void addClassLoader(ClassLoader classLoader, URL url) { try { Method method = URLClassLoader.class.getDeclaredMethod("addURL", - new Class[]{URL.class}); + new Class[]{URL.class}); method.setAccessible(true); method.invoke(classLoader, url); } catch (Exception eee) { @@ -175,7 +175,7 @@ /** * Retourner la liste des fichiers du classLoader. Ces fichiers doivent * correspondre au pattern donne. - * + * <p/> * Utile par defaut {@link ClassLoader#getSystemClassLoader()}. * * @param pattern le nom du fichier a extraire du fichier compressé ou @@ -244,8 +244,7 @@ String fileName; try { fileName = urlFile.toURI().getPath(); - } - catch (Exception e) { + } catch (Exception e) { if (log.isWarnEnabled()) { log.warn(e); } @@ -293,8 +292,8 @@ } if (log.isInfoEnabled()) { log.info("search URLs pattern: " + pattern + " in " - + arrayURL.length + " urls in " - + StringUtil.convertTime(System.nanoTime() - t0)); + + arrayURL.length + " urls in " + + StringUtil.convertTime(System.nanoTime() - t0)); } return urlList; } @@ -462,20 +461,20 @@ if (log.isTraceEnabled()) { log.trace("directory: " + repository + " name: " - + name); + + name); } // cas de recursivite : repertoire dans un repertoire if (file.exists() && file.isDirectory()) { urlList.addAll(getURLsFromDirectory(file, - pattern)); + pattern)); // si le fichier du repertoire n'est pas un repertoire // on verifie s'il correspond au pattern } else if (pattern == null || name.matches(pattern)) { URL url = file.toURI().toURL(); if (log.isTraceEnabled()) { log.trace("directory: " + repository + " url: " - + url); + + url); } urlList.add(url); } @@ -539,7 +538,7 @@ * @param clazz la classe dont on souhaite le type primitf * @return le type primitif associé a la classe en paramètre, ou null s'il * n'y a pas de type primitif associé. - * @deprecated since 2.2, use now the method {@link ObjectUtil#getPrimitiveClass(Class)} + * @deprecated since 2.2, use now the method {@link ObjectUtil#getPrimitiveClass(Class)} */ @Deprecated public static Class getPrimitiveClass(Class clazz) { @@ -585,10 +584,10 @@ /** * Return true if {@code str} is a pattern (contains * or ?). - * + * * @param str str to test - * @since 2.2 * @return {@code true} if {@code str} is a pattern, {@code false} otherwise + * @since 2.2 */ protected static boolean isPattern(String str) { return str.indexOf('*') != -1 || str.indexOf('?') != -1; @@ -596,10 +595,10 @@ /** * Find pattern resouces in {@link ClassLoader#getSystemClassLoader()}. - * + * * @param pattern java regex style pattern to find * @return url list found - * @throws IOException + * @throws IOException if any IO problem while seeking resources * @since 2.2 */ public static List<URL> getResources(String pattern) throws IOException { @@ -608,11 +607,11 @@ /** * Find pattern resouces in classloader. - * - * @param pattern java regex style pattern to find + * + * @param pattern java regex style pattern to find * @param classLoader classLoader * @return url list found - * @throws IOException + * @throws IOException if any IO problem while seeking resources * @since 2.2 */ public static List<URL> getResources(String pattern, @@ -625,8 +624,7 @@ if (isPattern(pattern)) { urlList = getPatternRessources(pattern, classLoader); - } - else { + } else { urlList = new HashList<URL>(); Enumeration<URL> resourceUrls = classLoader.getResources(pattern); while (resourceUrls.hasMoreElements()) { @@ -639,11 +637,13 @@ } /** - * - * @param pattern - * @param classLoader - * @return - * @throws IOException + * Obtain some resources from a pattern using a specific class loader to + * seel resources. + * + * @param pattern pattern of searched resources + * @param classLoader class loader which responsible to seek resources + * @return list of resources found + * @throws IOException if any IO problem while scanning resources * @since 2.2 */ protected static List<URL> getPatternRessources(String pattern, @@ -657,7 +657,8 @@ // /META-INF/persistence/*.xml -> /META-INF/persistence/ int prefixEnd = pattern.indexOf(":") + 1; int rootDirEnd = pattern.length(); - while (rootDirEnd > prefixEnd && isPattern(pattern.substring(prefixEnd, rootDirEnd))) { + while (rootDirEnd > prefixEnd && + isPattern(pattern.substring(prefixEnd, rootDirEnd))) { rootDirEnd = pattern.lastIndexOf('/', rootDirEnd - 2) + 1; } if (rootDirEnd == 0) { @@ -666,7 +667,8 @@ String rootDirPath = pattern.substring(0, rootDirEnd); String subPattern = pattern.substring(rootDirPath.length()); - Enumeration<URL> rootDirResources = classLoader.getResources(rootDirPath); + Enumeration<URL> rootDirResources = + classLoader.getResources(rootDirPath); while (rootDirResources.hasMoreElements()) { URL rootDirResource = rootDirResources.nextElement(); @@ -677,8 +679,7 @@ log.debug("jar to search " + rootDirResource); } urlList.addAll(doFindPathMatchingJarResources(rootDirResource, subPattern)); - } - else { + } else { urlList.addAll(doFindMatchingFileSystemResources(rootDirResource, subPattern)); } } @@ -688,10 +689,10 @@ /** * Test if an url detnoe a jar file. - * + * <p/> * Code taken from spring source code : - * org.springframework.core.io.support.PathMatchingResourcePatternResolver - * + * org.springframework.core.io.support.PathMatchingResourcePatternResolver + * * @param url url to test * @return true if url denote a jar file * @since 2.2 @@ -702,16 +703,16 @@ "zip".equals(protocol) || "wsjar".equals(protocol); } - + /** * Find all resources in jar files that match the given location pattern * via the Java Regex style Matcher. - * + * <p/> * Code taken from spring source code : - * org.springframework.core.io.support.PathMatchingResourcePatternResolver - * + * org.springframework.core.io.support.PathMatchingResourcePatternResolver + * * @param rootDirResource the root directory as Resource - * @param subPattern the sub pattern to match (below the root directory) + * @param subPattern the sub pattern to match (below the root directory) * @return the Set of matching Resource instances * @throws IOException in case of I/O errors * @see JarURLConnection @@ -734,8 +735,7 @@ jarFileUrl = jarCon.getJarFileURL().toExternalForm(); JarEntry jarEntry = jarCon.getJarEntry(); rootEntryPath = jarEntry != null ? jarEntry.getName() : ""; - } - else { + } else { // No JarURLConnection -> need to resort to URL file parsing. // We'll assume URLs of the format "jar:path!/entry", with the protocol // being arbitrary as long as following the entry format. @@ -748,12 +748,10 @@ //jarFile = getJarFile(jarFileUrl); if (jarFileUrl.startsWith("file:")) { jarFile = new JarFile(jarFileUrl.substring("file:".length())); - } - else { + } else { jarFile = new JarFile(jarFileUrl); } - } - else { + } else { jarFile = new JarFile(urlFile); jarFileUrl = urlFile; rootEntryPath = ""; @@ -783,8 +781,7 @@ } } return result; - } - finally { + } finally { // Close jar file, but only if freshly obtained - // not from JarURLConnection, which might cache the file reference. if (newJarFile) { @@ -792,16 +789,16 @@ } } } - + /** * Find all resources in the file system that match the given location pattern * via the Java style matcher. - * + * <p/> * Code taken from spring source code : - * org.springframework.core.io.support.PathMatchingResourcePatternResolver - * + * org.springframework.core.io.support.PathMatchingResourcePatternResolver + * * @param rootDirResource the root directory as Resource - * @param subPattern the sub pattern to match (below the root directory) + * @param subPattern the sub pattern to match (below the root directory) * @return the Set of matching Resource instances * @throws IOException in case of I/O errors * @see #retrieveMatchingFiles(File, String) @@ -810,13 +807,12 @@ protected static List<URL> doFindMatchingFileSystemResources(URL rootDirResource, String subPattern) throws IOException { - + File rootDir; try { rootDir = new File(rootDirResource.toURI().getSchemeSpecificPart()); rootDir = rootDir.getAbsoluteFile(); - } - catch (URISyntaxException ex) { + } catch (URISyntaxException ex) { return Collections.emptyList(); } return retrieveMatchingFiles(rootDir, subPattern); @@ -825,13 +821,13 @@ /** * Retrieve files that match the given path pattern, * checking the given directory and its subdirectories. - * + * <p/> * Code taken from spring source code : - * org.springframework.core.io.support.PathMatchingResourcePatternResolver - * + * org.springframework.core.io.support.PathMatchingResourcePatternResolver + * * @param rootDir the directory to start from * @param pattern the pattern to match against, - * relative to the root directory + * relative to the root directory * @return the Set of matching File instances * @throws IOException if directory contents could not be retrieved * @since 2.2 @@ -858,18 +854,18 @@ doRetrieveMatchingFiles(fullPattern, rootDir, result); return result; } - + /** * Recursively retrieve files that match the given pattern, * adding them to the given result list. - * + * <p/> * Code taken from spring source code : - * org.springframework.core.io.support.PathMatchingResourcePatternResolver - * + * org.springframework.core.io.support.PathMatchingResourcePatternResolver + * * @param fullPattern the pattern to match against, - * with preprended root directory path - * @param dir the current directory - * @param result the Set of matching File instances to add to + * with preprended root directory path + * @param dir the current directory + * @param result the Set of matching File instances to add to * @throws IOException if directory contents could not be retrieved * @since 2.2 */ @@ -878,7 +874,7 @@ List<URL> result) throws IOException { if (log.isDebugEnabled()) { log.debug("Searching directory [" + dir.getAbsolutePath() + - "] for files matching pattern [" + fullPattern + "]"); + "] for files matching pattern [" + fullPattern + "]"); } File[] dirContents = dir.listFiles(); if (dirContents == null) { @@ -895,10 +891,9 @@ if (!content.canRead()) { if (log.isDebugEnabled()) { log.debug("Skipping subdirectory [" + dir.getAbsolutePath() + - "] because the application is not allowed to read the directory"); + "] because the application is not allowed to read the directory"); } - } - else { + } else { doRetrieveMatchingFiles(fullPattern, content, result); } } Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/ResourceResolver.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/ResourceResolver.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/ResourceResolver.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -157,7 +157,7 @@ // if URI Matcher matcher = HREF_PATTERN.matcher(href); if (matcher.matches()) { - String protocol = matcher.group(1); +// String protocol = matcher.group(1); String path = matcher.group(2); // try look only with the filename // this is the last chance to find something :) Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/StringUtil.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/StringUtil.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/StringUtil.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -186,9 +186,9 @@ * example: * <li> substring("tatetitotu", -4) => totu * - * @param s + * @param s the string to substring * @param begin if begin < 0 then begin start at end of string - begin - * @return + * @return the result of substring */ static public String substring(String s, int begin) { String result = substring(s, begin, s.length()); @@ -201,10 +201,10 @@ * example: * <li> substring("tatetitotu", -4, -2) => to * - * @param s + * @param s the string to substring * @param begin if begin < 0 then begin start at end of string - begin * @param end if end < 0 then end start at end of string - end - * @return + * @return the result of substring */ static public String substring(String s, int begin, int end) { if (begin < 0) { @@ -693,7 +693,7 @@ * @throws IllegalStateException if could not found algorithm SHA1 */ public static String encodeSHA1(String toEncode) { - String result = null; + String result; try { MessageDigest sha1Md = MessageDigest.getInstance("SHA-1"); Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/package-info.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/package-info.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/beans/package-info.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -36,20 +36,21 @@ * This api permits to some object properties from an object to another one. * </p> * <h2>Obtain a binder</h2> - * A {@link Binder} contains a safe model named {@link Binder.BinderModel} which knows + * A {@link org.nuiton.util.beans.Binder} contains a safe model named + * {@link org.nuiton.util.beans.Binder.BinderModel} which knows * all properties that can be copied. * <br/> - * To use this api, you have only to get a {@link Binder} object from the - * {@link BinderFactory} like this : + * To use this api, you have only to get a {@link org.nuiton.util.beans.Binder} + * object from the {@link org.nuiton.util.beans.BinderFactory} like this : * <pre> * Binder<A, A> binder = BinderFactory.newBinder(A.class); * </pre> * * It is also possible to build a more sofisticated binder which will only copy - * some properties, using the {@link BinderModelBuilder}. + * some properties, using the {@link org.nuiton.util.beans.BinderModelBuilder}. * * <h2>Use a binder</h2> - * Once you have a binder, you use the {@link Binder} api : + * Once you have a binder, you use the {@link org.nuiton.util.beans.Binder} api : * <p/> * To copy all properties from an object to another one : * <pre> @@ -73,9 +74,11 @@ * * <h2>Building a new BinderModel</h2> * <p> - * In two words, you have to use the {@link BinderModelBuilder} object to do this. - * then register your binder model into the {@link BinderFactory} using - * one of the method {@code BinderFactory#registerBinderModel(XXX)}. + * In two words, you have to use the + * {@link org.nuiton.util.beans.BinderModelBuilder} object to do this. + * then register your binder model into the + * {@link org.nuiton.util.beans.BinderFactory} using one of the method + * {@code org.nuiton.util.beans.BinderFactory#registerBinderModel(XXX)}. * </p> * More explainations will come soon... * <br/> @@ -86,7 +89,7 @@ * * <h1>JavaBeans api</h1> * - * <h2>{@link BeanMonitor} class</h2> + * <h2>{@link org.nuiton.util.beans.BeanMonitor} class</h2> * This object permits to listen javaBeans and keep modifications made on a bean. * * More explanations will come soon, meanwhile you can see the test class : Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/converter/FormatMap.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/converter/FormatMap.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/converter/FormatMap.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -124,7 +124,7 @@ */ public Object convert(FormatConverterFactory factory, Format format, Object... args) { - Object result = null; + Object result; Map<Format, Object> values = this; //if (!values.containsKey(format) || // !format.equals(FormatConverter.FORMAT_JAVA)) { Added: trunk/nuiton-utils/src/main/java/org/nuiton/util/package-info.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/package-info.java (rev 0) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/package-info.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -0,0 +1,33 @@ +/* + * #%L + * Nuiton Utils :: Nuiton Utils + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2004 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ +/** + * Ensemble de classe Java permettant de simplifier le développement en + * factorisant des besoins que l'on retrouve dans tous les développement. + * On y trouve de fontion de travail sur les chaînes de caractères. Des + * fonctions de parsage des arguements de la ligne de commande. Des fonctions + * permettant très simplement de rechercher une resource (images, fichier de + * propriétés, ...). + */ +package org.nuiton.util; \ No newline at end of file Property changes on: trunk/nuiton-utils/src/main/java/org/nuiton/util/package-info.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/nuiton-utils/src/main/java/org/nuiton/util/package.html =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/package.html 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/package.html 2011-05-15 11:13:57 UTC (rev 2143) @@ -1,35 +0,0 @@ -<!-- - #%L - Nuiton Utils - - $Id$ - $HeadURL$ - %% - Copyright (C) 2004 - 2010 CodeLutin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - --> -<html> - <body> - <h1>Nuiton-utils</h1> -Ensemble de classe Java permettant de simplifier le développement en -factorisant des besoins que l'on retrouve dans tous les développement. -On y trouve de fontion de travail sur les chaînes de caractères. Des -fonctions de parsage des arguements de la ligne de commande. Des fonctions -permettant très simplement de rechercher une resource (images, fichier de -propriétés, ...) - </body> -</html> \ No newline at end of file Modified: trunk/nuiton-utils/src/main/java/org/nuiton/util/rmi/package-info.java =================================================================== --- trunk/nuiton-utils/src/main/java/org/nuiton/util/rmi/package-info.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/main/java/org/nuiton/util/rmi/package-info.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -27,9 +27,9 @@ * then get a proxy to access them. The provided classes will hide RMI * complexity. * <p/> - * Use the {@link ServiceExporter} to register an service to the RMI registry. + * Use the {@link org.nuiton.util.rmi.ServiceExporter} to register an service to the RMI registry. * <p/> - * Use the {@link RemoteProxyFactory} to get a proxy an call the RMI exported + * Use the {@link org.nuiton.util.rmi.RemoteProxyFactory} to get a proxy an call the RMI exported * service. * * @author Arnaud Thimel <thimel@codelutin.com> Modified: trunk/nuiton-utils/src/test/java/org/nuiton/util/MD5InputStreamTest.java =================================================================== --- trunk/nuiton-utils/src/test/java/org/nuiton/util/MD5InputStreamTest.java 2011-05-15 10:40:37 UTC (rev 2142) +++ trunk/nuiton-utils/src/test/java/org/nuiton/util/MD5InputStreamTest.java 2011-05-15 11:13:57 UTC (rev 2143) @@ -871,7 +871,7 @@ // define settings which are OS arch architecture independent File arch_lib_path = null; - String arch_libfile_suffix = null; + String arch_libfile_suffix; // fill in settings for Linux on x86