Java Doc for PropertyEditorManager.java in  » 6.0-JDK-Core » beans » java » beans » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » beans » java.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.beans.PropertyEditorManager

PropertyEditorManager
public class PropertyEditorManager (Code)
The PropertyEditorManager can be used to locate a property editor for any given type name. This property editor must support the java.beans.PropertyEditor interface for editing a given object.

The PropertyEditorManager uses three techniques for locating an editor for a given type. First, it provides a registerEditor method to allow an editor to be specifically registered for a given type. Second it tries to locate a suitable class by adding "Editor" to the full qualified classname of the given type (e.g. "foo.bah.FozEditor"). Finally it takes the simple classname (without the package name) adds "Editor" to it and looks in a search-path of packages for a matching class.

So for an input class foo.bah.Fred, the PropertyEditorManager would first look in its tables to see if an editor had been registered for foo.bah.Fred and if so use that. Then it will look for a foo.bah.FredEditor class. Then it will look for (say) standardEditorsPackage.FredEditor class.

Default PropertyEditors will be provided for the Java primitive types "boolean", "byte", "short", "int", "long", "float", and "double"; and for the classes java.lang.String. java.awt.Color, and java.awt.Font.





Method Summary
public static synchronized  PropertyEditorfindEditor(Class targetType)
     Locate a value editor for a given target type.
Parameters:
  targetType - The Class object for the type to be edited An editor object for the given target class.
public static synchronized  String[]getEditorSearchPath()
     Gets the package names that will be searched for property editors. The array of package names that will be searched inorder to find property editors.

The default value for this array is implementation-dependent,e.g.

public static  voidregisterEditor(Class targetType, Class editorClass)
     Register an editor class to be used to edit values of a given target class.

First, if there is a security manager, its checkPropertiesAccess method is called.

public static synchronized  voidsetEditorSearchPath(String path)
     Change the list of package names that will be used for finding property editors.

First, if there is a security manager, its checkPropertiesAccess method is called.




Method Detail
findEditor
public static synchronized PropertyEditor findEditor(Class targetType)(Code)
Locate a value editor for a given target type.
Parameters:
  targetType - The Class object for the type to be edited An editor object for the given target class. The result is null if no suitable editor can be found.



getEditorSearchPath
public static synchronized String[] getEditorSearchPath()(Code)
Gets the package names that will be searched for property editors. The array of package names that will be searched inorder to find property editors.

The default value for this array is implementation-dependent,e.g. Sun implementation initially sets to {"sun.beans.editors"}.




registerEditor
public static void registerEditor(Class targetType, Class editorClass)(Code)
Register an editor class to be used to edit values of a given target class.

First, if there is a security manager, its checkPropertiesAccess method is called. This could result in a SecurityException.
Parameters:
  targetType - the Class object of the type to be edited
Parameters:
  editorClass - the Class object of the editor class. Ifthis is null, then any existing definition will be removed.
exception:
  SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow settingof system properties.
See Also:   SecurityManager.checkPropertiesAccess




setEditorSearchPath
public static synchronized void setEditorSearchPath(String path)(Code)
Change the list of package names that will be used for finding property editors.

First, if there is a security manager, its checkPropertiesAccess method is called. This could result in a SecurityException.
Parameters:
  path - Array of package names.
exception:
  SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow settingof system properties.
See Also:   SecurityManager.checkPropertiesAccess




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.