org.apache.geronimo.common.propertyeditor
Class PropertyEditors

java.lang.Object
  extended by org.apache.geronimo.common.propertyeditor.PropertyEditors

public class PropertyEditors
extends Object

The property editor manager. This orchestrates Geronimo usage of property editors, allowing additional search paths to be added and specific editors to be registered.


Constructor Summary
PropertyEditors()
           
 
Method Summary
static void appendEditorSearchPath(List newNames)
          Append additional package names to the property editor search path.
static void appendEditorSearchPath(String newName)
          Append a single package name to the editor search path.
static void appendEditorSearchPath(String[] newNames)
          Append an array of package names to the editor search path.
static PropertyEditor findEditor(Class type)
          Locate an editor for qiven class of object.
static PropertyEditor findEditor(String typeName, ClassLoader loader)
          Locate an editor for qiven class of object, resolved within the context of a specific ClassLoader instance.
static PropertyEditor getEditor(Class type)
          Get a property editor for a given property type.
static List getEditorSearchPath()
          Get a list containing all of the packages in the editor search path.
static void registerEditor(Class type, Class editorType)
          Explicity register an editor class for a given target class.
static void registerEditor(String typeName, String editorName)
          Explicity register a property/editor class pair by class name.
static void setEditorSearchPath(List path)
          Sets the search order used for property editor resolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyEditors

public PropertyEditors()
Method Detail

findEditor

public static PropertyEditor findEditor(Class type)
Locate an editor for qiven class of object.

Parameters:
type - The target object class of the property.
Returns:
The resolved editor, if any. Returns null if a suitable editor could not be located.

findEditor

public static PropertyEditor findEditor(String typeName,
                                        ClassLoader loader)
                                 throws ClassNotFoundException
Locate an editor for qiven class of object, resolved within the context of a specific ClassLoader instance.

Parameters:
typeName - The type name of target property class.
loader - The source ClassLoader instance.
Returns:
The resolved editor, if any. Returns null if a suitable editor could not be located.
Throws:
ClassNotFoundException - Thrown if unable to resolve an appropriate editor class.

getEditor

public static PropertyEditor getEditor(Class type)
Get a property editor for a given property type. This is like findEditor, but throws an exception if the property is not found.

Parameters:
type - The target object class of the property.
Returns:
The resolved editor, if any. Throws an exception if this cannot be resolved.
Throws:
PropertyEditorException - Unable to find a suitable editor for this class.

registerEditor

public static void registerEditor(Class type,
                                  Class editorType)
Explicity register an editor class for a given target class.

Parameters:
type - The property class.
editorType - The editor class matched up with this type.

registerEditor

public static void registerEditor(String typeName,
                                  String editorName)
                           throws ClassNotFoundException
Explicity register a property/editor class pair by class name.

Parameters:
typeName - The classname of the property.
editorName - The classname of the property editor.
Throws:
ClassNotFoundException - Thrown if unable to resolve either the type or the editor from their names.

getEditorSearchPath

public static List getEditorSearchPath()
Get a list containing all of the packages in the editor search path.

Returns:
a List object containing all of the registered search paths.

setEditorSearchPath

public static void setEditorSearchPath(List path)
Sets the search order used for property editor resolution.

Parameters:
path - The serach path.

appendEditorSearchPath

public static void appendEditorSearchPath(List newNames)
Append additional package names to the property editor search path.

Parameters:
names - The package names to append.

appendEditorSearchPath

public static void appendEditorSearchPath(String[] newNames)
Append an array of package names to the editor search path.

Parameters:
names - A string array containing the added names.

appendEditorSearchPath

public static void appendEditorSearchPath(String newName)
Append a single package name to the editor search path.

Parameters:
name - The new path name.


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.