[Ejtools-cvs] libraries/common/src/main/org/ejtools/beans package.html,NONE,1.1 CustomPropertyEditor
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 10:50:07
|
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/beans Modified Files: CustomPropertyEditorManager.java Sort.java Added Files: package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides utility classes related to the JavaBeans. </body> </html> Index: CustomPropertyEditorManager.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans/CustomPropertyEditorManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CustomPropertyEditorManager.java 15 Sep 2003 22:23:44 -0000 1.7 --- CustomPropertyEditorManager.java 13 Dec 2003 21:27:49 -0000 1.8 *************** *** 1,71 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.beans; ! ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Vector; ! ! /** ! * Decorator class to enhance the functionnality of the {@link PropertyEditorManager}. ! * If a PropertyEditor is not found, a PropertyEditor matching one of the implemented interfaces ! * is searched. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class CustomPropertyEditorManager extends PropertyEditorManager ! { ! /** Description of the Field */ ! public final static String EDITORS_PACKAGE = "org.ejtools.adwt.editor"; ! ! ! /** ! * Add super interfaces search when finding a PropertyEditor ! * ! * @param clazz The class of the property ! * @return The PropertyEditor found, null otherwise ! */ ! public static synchronized PropertyEditor findEditor(Class clazz) ! { ! PropertyEditor result = PropertyEditorManager.findEditor(clazz); ! ! // If the PropertyEditor is not found in mapping, it is the first time it is required ! // so fetch it by the PropertyEditorManager ! if (result == null) ! { ! // Search among the interfaces if there is one that has a PropertyEditor ! Class[] interfaces = clazz.getInterfaces(); ! for (int i = 0; i < interfaces.length; i++) ! { ! Class current = interfaces[i]; ! result = PropertyEditorManager.findEditor(current); ! if (result != null) ! { ! PropertyEditorManager.registerEditor(clazz, result.getClass()); ! break; ! } ! } ! } ! ! return result; ! } ! ! /** Add a new package for the search */ ! static ! { ! String[] paths = PropertyEditorManager.getEditorSearchPath(); ! Vector newPaths = new Vector(); ! newPaths.addAll(Arrays.asList(paths)); ! if (!newPaths.contains(EDITORS_PACKAGE)) ! { ! newPaths.add(EDITORS_PACKAGE); ! } ! PropertyEditorManager.setEditorSearchPath((String[]) newPaths.toArray(new String[0])); ! } ! } --- 1,71 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.beans; ! ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Vector; ! ! /** ! * Decorator class to enhance the functionnality of the {@link PropertyEditorManager}. ! * If a PropertyEditor is not found, a PropertyEditor matching one of the implemented interfaces ! * is searched. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class CustomPropertyEditorManager extends PropertyEditorManager ! { ! /** Description of the Field */ ! public final static String EDITORS_PACKAGE = "org.ejtools.adwt.editor"; ! ! ! /** ! * Add super interfaces search when finding a PropertyEditor ! * ! * @param clazz The class of the property ! * @return The PropertyEditor found, null otherwise ! */ ! public static synchronized PropertyEditor findEditor(Class clazz) ! { ! PropertyEditor result = PropertyEditorManager.findEditor(clazz); ! ! // If the PropertyEditor is not found in mapping, it is the first time it is required ! // so fetch it by the PropertyEditorManager ! if (result == null) ! { ! // Search among the interfaces if there is one that has a PropertyEditor ! Class[] interfaces = clazz.getInterfaces(); ! for (int i = 0; i < interfaces.length; i++) ! { ! Class current = interfaces[i]; ! result = CustomPropertyEditorManager.findEditor(current); ! if (result != null) ! { ! PropertyEditorManager.registerEditor(clazz, result.getClass()); ! break; ! } ! } ! } ! ! return result; ! } ! ! /** Add a new package for the search */ ! static ! { ! String[] paths = PropertyEditorManager.getEditorSearchPath(); ! Vector newPaths = new Vector(); ! newPaths.addAll(Arrays.asList(paths)); ! if (!newPaths.contains(EDITORS_PACKAGE)) ! { ! newPaths.add(EDITORS_PACKAGE); ! } ! PropertyEditorManager.setEditorSearchPath((String[]) newPaths.toArray(new String[0])); ! } ! } Index: Sort.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans/Sort.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sort.java 15 Sep 2003 22:23:45 -0000 1.6 --- Sort.java 13 Dec 2003 21:27:49 -0000 1.7 *************** *** 20,25 **** * @version $Revision$ */ ! public abstract class Sort { /** * Extract the elements of the specified class from the Iterator. --- 20,29 ---- * @version $Revision$ */ ! public class Sort { + /** Constructor for the Sort object */ + private Sort() { } + + /** * Extract the elements of the specified class from the Iterator. |