|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.propertyeditor.PropertyEditors
A collection of PropertyEditor utilities. Provides the same interface as PropertyManagerEditor plus more...
Installs the default PropertyEditors.
Constructor Summary | |
PropertyEditors()
|
Method Summary | |
static java.lang.Object |
convertValue(java.lang.String text,
java.lang.String typeName)
Convert a string value into the true value for typeName using the PropertyEditor associated with typeName. |
static java.beans.PropertyEditor |
findEditor(java.lang.Class type)
Locate a value editor for a given target type. |
static java.beans.PropertyEditor |
findEditor(java.lang.String typeName)
Locate a value editor for a given target type. |
static java.beans.PropertyEditor |
getEditor(java.lang.Class type)
Get a value editor for a given target type. |
static java.beans.PropertyEditor |
getEditor(java.lang.String typeName)
Get a value editor for a given target type. |
java.lang.String[] |
getEditorSearchPath()
Gets the package names that will be searched for property editors. |
static void |
mapJavaBeanProperties(java.lang.Object bean,
java.util.Properties beanProps)
This method takes the properties found in the given beanProps to the bean using the property editor registered for the property. |
static void |
mapJavaBeanProperties(java.lang.Object bean,
java.util.Properties beanProps,
boolean isStrict)
This method takes the properties found in the given beanProps to the bean using the property editor registered for the property. |
static void |
registerEditor(java.lang.Class type,
java.lang.Class editorType)
Register an editor class to be used to editor values of a given target class. |
static void |
registerEditor(java.lang.String typeName,
java.lang.String editorTypeName)
Register an editor class to be used to editor values of a given target class. |
void |
setEditorSearchPath(java.lang.String[] path)
Sets the package names that will be searched for property editors. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyEditors()
Method Detail |
public static java.beans.PropertyEditor findEditor(java.lang.Class type)
type
- The class of the object to be edited.
public static java.beans.PropertyEditor findEditor(java.lang.String typeName) throws java.lang.ClassNotFoundException
typeName
- The class name of the object to be edited.
java.lang.ClassNotFoundException
public static java.beans.PropertyEditor getEditor(java.lang.Class type)
type
- The class of the object to be edited.
java.lang.RuntimeException
- No editor was found.public static java.beans.PropertyEditor getEditor(java.lang.String typeName) throws java.lang.ClassNotFoundException
typeName
- The class name of the object to be edited.
java.lang.RuntimeException
- No editor was found.
java.lang.ClassNotFoundException
public static void registerEditor(java.lang.Class type, java.lang.Class editorType)
type
- The class of the objetcs to be edited.editorType
- The class of the editor.public static void registerEditor(java.lang.String typeName, java.lang.String editorTypeName) throws java.lang.ClassNotFoundException
typeName
- The classname of the objetcs to be edited.editorTypeName
- The class of the editor.
java.lang.ClassNotFoundException
public static java.lang.Object convertValue(java.lang.String text, java.lang.String typeName) throws java.lang.ClassNotFoundException, java.beans.IntrospectionException
text
- the string represention of the value. This is passed to
the PropertyEditor.setAsText method.typeName
- the fully qualified class name of the true value type
java.lang.ClassNotFoundException
- thrown if the typeName class cannot
be found
java.beans.IntrospectionException
- thrown if a PropertyEditor for typeName
cannot be foundpublic static void mapJavaBeanProperties(java.lang.Object bean, java.util.Properties beanProps) throws java.beans.IntrospectionException
bean
- - the java bean instance to apply the properties tobeanProps
- - map of java bean property name to property value.
java.beans.IntrospectionException
- thrown on introspection of bean and if
a property in beanProps does not map to a property of bean.public static void mapJavaBeanProperties(java.lang.Object bean, java.util.Properties beanProps, boolean isStrict) throws java.beans.IntrospectionException
bean
- - the java bean instance to apply the properties tobeanProps
- - map of java bean property name to property value.isStrict
- - indicates if should throw exception if bean property can not
be matched. True for yes, false for no.
java.beans.IntrospectionException
- thrown on introspection of bean and if
a property in beanProps does not map to a property of bean.public java.lang.String[] getEditorSearchPath()
public void setEditorSearchPath(java.lang.String[] path)
path
- The serach path.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |