Interface SilverpeasBundle

    • Method Detail

      • keySet

        Set<String> keySet()
        Gets a set of all keys defined in this bundle.
        Returns:
        a set of keys.
      • containsKey

        boolean containsKey​(String key)
        Is this bundle contains the specified data
        Parameters:
        key - the name of the data.
        Returns:
        true if this bundle has a data with the specified key, false otherwise.
      • getBaseBundleName

        String getBaseBundleName()
        What is the fully qualified name of this bundle.
        Returns:
        the base bundle name (that is to say without the hierarchy path name that is handled by org.silverpeas.core.util.ResourceLocator).
      • getString

        String getString​(String key)
        Gets the value as a String of the data identified by the specified key. The key should exist in the bundle otherwise a java.util.MissingResourceException exception is thrown.
        Parameters:
        key - the unique name of the data in this bundle.
        Returns:
        the value of the data as a string of characters.
        Throws:
        MissingResourceException - if either the bundle doesn't exist or the key isn't defined in the bundle.
      • getStringList

        default SilverpeasBundleList getStringList​(String list,
                                                   String property)
                                            throws MissingResourceException
        The resource is a list of objects. Gets the value(s) of the specified property of one or more objects in the list. The objects in the list are identified by their index in the list (from 1 to n). The key used to find the asked value(s) is composed first by the list identifier, an underscore separator, then by the index of the object in the list, a dot separator, and finally ends with the object's property name.
        For example :
        • User_1.Name=firstName
        • User_2.Name=lastName
        • ...
        If the computed key isn't defined in the bundle, then no MissingResourceException exception is thrown (for compatibility reason with Silverpeas versions lesser than 6).
        Parameters:
        list - the identifier of the list in the bundle.
        property - the object's property for which the value will be fetch. iterated up to find an object whose the property is set. If max is >= 1 then the specified property of the first max objects are read (if the property isn't set for an object, it is set to an empty string).
        Returns:
        an array of string with several values. If the property of an object to read exists but isn't set, then an empty string is set in the array.
        Throws:
        MissingResourceException - if the bundle doesn't exist.
      • getStringList

        default SilverpeasBundleList getStringList​(String list,
                                                   String property,
                                                   int max)
                                            throws MissingResourceException
        The resource is a list of objects. Gets the value(s) of the specified property of one or more objects in the list. The objects in the list are identified by their index in the list (from 1 to n). The key used to find the asked value(s) is composed first by the list identifier, an underscore separator, then by the index of the object in the list, a dot separator, and finally ends with the object's property name.
        For example :
        • User_1.Name=firstName
        • User_2.Name=lastName
        • ...
        If the computed key isn't defined in the bundle, then no MissingResourceException exception is thrown (for compatibility reason with Silverpeas versions lesser than 6).
        Parameters:
        list - the identifier of the list in the bundle.
        property - the object's property for which the value will be fetch.
        max - the maximum number of objects to read from 1 to n. If max is -1 then the list is iterated up to find an object whose the property is set. If max is >= 1 then the specified property of the first max objects are read (if the property isn't set for an object, it is set to an empty string).
        Returns:
        an array of string with one property value (if max is 1) or with several values (if max = -1 or > 1). If the property of an object to read exists but isn't set, then an empty string is set in the array.
        Throws:
        MissingResourceException - if the bundle doesn't exist.
      • exists

        boolean exists()
        Is this bundle exists?
        Returns:
        true if this bundle exists, false otherwise.