oracle.bali.share.beans
Class JavaPropertyEditorManager
java.lang.Object
|
+--oracle.bali.share.beans.JavaPropertyEditorManager
- public class JavaPropertyEditorManager
- extends java.lang.Object
Version of java.beans.PropertyEditorManager
that
caches the editor returned by findEditor
. This
includes caching cache misses. This greatly improves
performance due to the the large number of places the
PropertyEditormanager
looks for
editors for a class.
Due to the above performance enhancements, users should always
use this class in place of PropertyEditorManager
.
Doing so is safe, since the JavaPropertyEditorManager
always pushes calls to registerEditor
through to
the underlying PropertyEditorManager
, while
delegating to PropertyEditorManager
when the desired
class can not be found in the JavaPropertyEditorManager
's
editor cache.
- Since:
- Share 1.0
- See Also:
PropertyEditorManager
Method Summary |
static java.beans.PropertyEditor |
findEditor(java.lang.Class targetType)
Locate a value editor for a given target type. |
static java.lang.String[] |
getEditorSearchPath()
|
static void |
registerEditor(java.lang.Class targetType,
java.lang.Class editorClass)
Register an editor class to be used to editor values of
a given target class. |
static void |
setEditorSearchPath(java.lang.String[] path)
Change the list of package names that will be used for
finding property editors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaPropertyEditorManager
public JavaPropertyEditorManager()
registerEditor
public static void registerEditor(java.lang.Class targetType,
java.lang.Class editorClass)
- Register an editor class to be used to editor values of
a given target class.
- Parameters:
targetType
- the Class object of the type to be editededitorClass
- the Class object of the editor class. If
this is null, then any existing definition will be removed.
findEditor
public static java.beans.PropertyEditor findEditor(java.lang.Class targetType)
- Locate a value editor for a given target type.
- Parameters:
targetType
- The Class object for the type to be edited- Returns:
- An editor object for the given target class.
The result is null if no suitable editor can be found.
getEditorSearchPath
public static java.lang.String[] getEditorSearchPath()
- Returns:
- The array of package names that will be searched in
order to find property editors.
This is initially set to {"sun.beans.editors"}.
setEditorSearchPath
public static void setEditorSearchPath(java.lang.String[] path)
- Change the list of package names that will be used for
finding property editors.
- Parameters:
path
- Array of package names.