KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > varia > property > PropertyEditorManagerServiceMBean


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2005, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.varia.property;
23
24 import java.beans.PropertyEditor JavaDoc;
25 import java.util.Properties JavaDoc;
26
27 import javax.management.ObjectName JavaDoc;
28
29 import org.jboss.mx.util.ObjectNameFactory;
30 import org.jboss.system.ServiceMBean;
31
32 /**
33  * MBean interface.
34  *
35  * @version $Revision: 39232 $
36  */

37 public interface PropertyEditorManagerServiceMBean extends ServiceMBean
38 {
39    /** The default object name */
40    ObjectName JavaDoc OBJECT_NAME = ObjectNameFactory.create("jboss.varia:type=Service,name=PropertyEditorManager");
41
42    // Attributes ----------------------------------------------------
43

44    /**
45     * Load property editors based on the given properties string.
46     * @param props, A string representation of a editor.class=editor.type Properties map for the editors to load.
47     */

48    void setBootstrapEditors(String JavaDoc propsString) throws ClassNotFoundException JavaDoc, java.io.IOException JavaDoc;
49    
50    /**
51     * Set property editors based on the given properties map.
52     * @param props Map of <em>type name</em> to </em>editor type name</em>.
53     */

54    void setEditors(Properties JavaDoc props) throws ClassNotFoundException JavaDoc;
55    
56    /**
57     * The package names that will be searched for property editors.
58     */

59    void setEditorSearchPath(String JavaDoc path);
60    String JavaDoc getEditorSearchPath();
61
62    /**
63     * A list of registered editor classes.
64     */

65    Class JavaDoc[] getRegisteredEditors();
66
67    // Operations ----------------------------------------------------
68

69    /**
70     * Locate a value editor for a given target type.
71     * @param type The class of the object to be edited.
72     * @return An editor for the given type or null if none was found.
73     */

74    PropertyEditor JavaDoc findEditor(Class JavaDoc type);
75
76    /**
77     * Locate a value editor for a given target type.
78     * @param typeName The class name of the object to be edited.
79     * @return An editor for the given type or null if none was found.
80     */

81    PropertyEditor JavaDoc findEditor(String JavaDoc typeName) throws ClassNotFoundException JavaDoc;
82
83    /**
84     * Register an editor class to be used to editor values of a given target class.
85     * @param type The class of the objetcs to be edited.
86     * @param editorType The class of the editor.
87     */

88    void registerEditor(Class JavaDoc type, Class JavaDoc editorType);
89
90    /**
91     * Register an editor class to be used to editor values of a given target class.
92     * @param typeName The classname of the objetcs to be edited.
93     * @param editorTypeName The class of the editor.
94     */

95    void registerEditor(String JavaDoc typeName, String JavaDoc editorTypeName) throws ClassNotFoundException JavaDoc;
96
97 }
98
Popular Tags