/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.varia.property;

/**
 * MBean interface.
 */
public interface PropertyEditorManagerServiceMBean extends org.jboss.system.ServiceMBean
{

   //default object name
   public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory
         .create("jboss.varia:type=Service,name=PropertyEditorManager");

   /**
    * Locate a value editor for a given target type.
    * @param type The class of the object to be edited.
    * @return An editor for the given type or null if none was found.    */
   java.beans.PropertyEditor findEditor(java.lang.Class type);

   /**
    * Locate a value editor for a given target type.
    * @param typeName The class name of the object to be edited.
    * @return An editor for the given type or null if none was found.    */
   java.beans.PropertyEditor findEditor(java.lang.String typeName) throws java.lang.ClassNotFoundException;

   /**
    * Register an editor class to be used to editor values of a given target class.
    * @param type The class of the objetcs to be edited.
    * @param editorType The class of the editor.    */
   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.
    * @param typeName The classname of the objetcs to be edited.
    * @param editorTypeName The class of the editor.    */
   void registerEditor(java.lang.String typeName, java.lang.String editorTypeName)
         throws java.lang.ClassNotFoundException;

   /**
    * Gets the package names that will be searched for property editors.
    * @return The package names that will be searched for property editors.    */
   java.lang.String getEditorSearchPath();

   /**
    * Sets the package names that will be searched for property editors.
    * @param path A comma sperated list of package names.    */
   void setEditorSearchPath(java.lang.String path);

   /**
    * Load property editors based on the given properties string.
    * @param props, A string representation of a editor.class=editor.type Properties map for the editors to load.    */
   void setBootstrapEditors(java.lang.String propsString) throws java.lang.ClassNotFoundException, java.io.IOException;

   /**
    * Set property editors based on the given properties map.
    * @param props Map of <em>type name</em> to </em>editor type name</em>.    */
   void setEditors(java.util.Properties props) throws java.lang.ClassNotFoundException;

}
