javax.el

Class ResourceBundleELResolver

    • Constructor Detail

      • ResourceBundleELResolver

        public ResourceBundleELResolver()
    • Method Detail

      • getValue

        public Object getValue(ELContext context,
                               Object base,
                               Object property)
        If the base object is an instance of ResourceBundle, the provided property will first be coerced to a String. The Object returned by getObject on the base ResourceBundle will be returned.

        If the base is ResourceBundle, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

        Specified by:
        getValue in class ELResolver
        Parameters:
        context - The context of this evaluation.
        base - The ResourceBundle to analyze.
        property - The name of the property to analyze. Will be coerced to a String.
        Returns:
        If the propertyResolved property of ELContext was set to true, then null if property is null; otherwise the Object for the given key (property coerced to String) from the ResourceBundle. If no object for the given key can be found, then the String "???" + key + "???".
        Throws:
        NullPointerException - if context is null
        ELException - if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
      • getType

        public Class<?> getType(ELContext context,
                                Object base,
                                Object property)
        If the base object is an instance of ResourceBundle, return null, since the resolver is read only.

        If the base is ResourceBundle, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value.

        Specified by:
        getType in class ELResolver
        Parameters:
        context - The context of this evaluation.
        base - The ResourceBundle to analyze.
        property - The name of the property to analyze.
        Returns:
        If the propertyResolved property of ELContext was set to true, then null; otherwise undefined.
        Throws:
        NullPointerException - if context is null
      • isReadOnly

        public boolean isReadOnly(ELContext context,
                                  Object base,
                                  Object property)
        If the base object is not null and an instanceof ResourceBundle, return true.
        Specified by:
        isReadOnly in class ELResolver
        Parameters:
        context - The context of this evaluation.
        base - The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.
        property - The String property to use.
        Returns:
        If the propertyResolved property of ELContext was set to true, then true; otherwise undefined.
        Throws:
        NullPointerException - if context is null
      • getFeatureDescriptors

        public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
                                                                 Object base)
        If the base object is a ResourceBundle, returns an Iterator containing the set of keys available in the ResourceBundle. Otherwise, returns null.

        The Iterator returned must contain zero or more instances of FeatureDescriptor. Each info object contains information about a key in the ResourceBundle, and is initialized as follows:

      • displayName - The String key
      • name - Same as displayName property.
      • shortDescription - Empty string
      • expert - false
      • hidden - false
      • preferred - true
      • In addition, the following named attributes must be set in the returned FeatureDescriptors:
      • ELResolver.TYPE - String.class
      • ELResolver.RESOLVABLE_AT_DESIGN_TIME - true
      • Specified by:
        getFeatureDescriptors in class ELResolver
        Parameters:
        context - The context of this evaluation.
        base - The bundle whose keys are to be iterated over. Only bases of type ResourceBundle are handled by this resolver.
        Returns:
        An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, each representing a key in this bundle, or null if the base object is not a ResourceBundle.
        See Also:
        FeatureDescriptor
      • getCommonPropertyType

        public Class<?> getCommonPropertyType(ELContext context,
                                              Object base)
        If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

        Assuming the base is a ResourceBundle, this method will always return String.class.

        Specified by:
        getCommonPropertyType in class ELResolver
        Parameters:
        context - The context of this evaluation.
        base - The bundle to analyze. Only bases of type ResourceBundle are handled by this resolver.
        Returns:
        null if base is not a ResourceBundle; otherwise String.class.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/el/resourcebundleelresolver.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.