JBoss Common Beans 1.1.0.Final-redhat-1

org.jboss.common.beans.property.finder
Class PropertyEditorFinder

java.lang.Object
  extended by org.jboss.common.beans.property.finder.PropertyEditorFinder
Direct Known Subclasses:
DefaultPropertyEditorFinder

public abstract class PropertyEditorFinder
extends Object

Simple abstract class to provide base for PropertyEditorFinder service.

Author:
baranowb

Field Summary
protected static String EDITOR
           
protected static String EDITOR_ARRAY
           
protected static Logger logger
           
 
Constructor Summary
PropertyEditorFinder()
           
 
Method Summary
abstract  PropertyEditor find(Class<?> type)
          Returns PropertyEditor which capable of converting String into instances of type parameter.
abstract  String[] getEditorSearchPackages()
           
static PropertyEditorFinder getInstance()
          Returns instance of property finder.
abstract  void register(Class<?> type, Class<? extends PropertyEditor> editor)
          If supported, this method register editor class for specific type.
abstract  void setEditorSearchPackages(String[] packages)
          If supported this sets search packages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Logger logger

EDITOR

protected static final String EDITOR
See Also:
Constant Field Values

EDITOR_ARRAY

protected static final String EDITOR_ARRAY
See Also:
Constant Field Values
Constructor Detail

PropertyEditorFinder

public PropertyEditorFinder()
Method Detail

find

public abstract PropertyEditor find(Class<?> type)
Returns PropertyEditor which capable of converting String into instances of type parameter.

Parameters:
type - - class object representing type of property beeing converted from String to object instance.
Returns:

register

public abstract void register(Class<?> type,
                              Class<? extends PropertyEditor> editor)
If supported, this method register editor class for specific type. When queried, finder will return registered editor class. Check {find(Class) method.

Parameters:
type - - class object representing type of property, ie. int[].class, InetAddress.class
editor - - editor class which is capable of converting type, to and from String.

setEditorSearchPackages

public abstract void setEditorSearchPackages(String[] packages)
If supported this sets search packages. Finder will search those packages for viable editor classe.

Parameters:
packages - - set of packages, ie. {"com.sun.beans","custom.editors"}

getEditorSearchPackages

public abstract String[] getEditorSearchPackages()
Returns:
- current search packages.

getInstance

public static PropertyEditorFinder getInstance()
Returns instance of property finder. Instance is loaded as service. If no service is found, this method, this method will return null.

Returns:
Instance of PropertyEditorFinder.

JBoss Common Beans 1.1.0.Final-redhat-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.