Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
java.beans

Class PropertyEditorManager


  • public class PropertyEditorManager
    extends Object
    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.

    • Constructor Detail

      • PropertyEditorManager

        public PropertyEditorManager()
    • Method Detail

      • registerEditor

        public static void registerEditor(Class<?> targetType,
                          Class<?> editorClass)
        Registers an editor class to edit values of the given target class. If the editor class is null, then any existing definition will be removed. Thus this method can be used to cancel the registration. The registration is canceled automatically if either the target or editor class is unloaded.

        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
        editorClass - the class object of the editor class
        Throws:
        SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow setting of system properties
        See Also:
        SecurityManager.checkPropertiesAccess()
      • findEditor

        public static PropertyEditor findEditor(Class<?> targetType)
        Locate a value editor for a given target type.
        Parameters:
        targetType - The Class object for the type to be edited
        Returns:
        An editor object for the given target class. The result is null if no suitable editor can be found.
      • getEditorSearchPath

        public static String[] getEditorSearchPath()
        Gets the package names that will be searched for property editors.
        Returns:
        The array of package names that will be searched in order to find property editors.

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

      • setEditorSearchPath

        public static void setEditorSearchPath(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. This could result in a SecurityException.

        Parameters:
        path - Array of package names.
        Throws:
        SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow setting of system properties.
        See Also:
        SecurityManager.checkPropertiesAccess()

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/beans/propertyeditormanager.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut