Enum EWebScope

  • All Implemented Interfaces:
    Serializable, Comparable<EWebScope>

    public enum EWebScope
    extends Enum<EWebScope>
    This enumeration defines all the possible web scopes including some utility methods on it.
    Author:
    Philip Helger
    • Enum Constant Detail

      • GLOBAL

        public static final EWebScope GLOBAL
        The global scope.
      • SESSION

        public static final EWebScope SESSION
        The session scope
      • REQUEST

        public static final EWebScope REQUEST
        The request scope.
    • Method Detail

      • values

        public static EWebScope[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EWebScope c : EWebScope.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EWebScope valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getScope

        @Nonnull
        public IWebScope getScope()
        Returns:
        The current IWebScope object for this enum. Aequivalent to getScope(true) and therefore never null.
      • getScope

        @Nullable
        public IWebScope getScope​(boolean bCreateIfNotExisting)
        Get the current web scope object of this enum entry.
        Parameters:
        bCreateIfNotExisting - if true the scope is created if it is not existing.
        Returns:
        null if the scope is not existing yet and should not be created. Always non-null if the parameter is true.
      • getScope

        @Nullable
        public static IWebScope getScope​(@Nonnull
                                         EWebScope eWebScope,
                                         boolean bCreateIfNotExisting)
        Resolve the currently matching web scope of the given EWebScope value.
        Parameters:
        eWebScope - The web scope to resolve to a real scope. May not be null.
        bCreateIfNotExisting - if false and the scope is not existing, null will be returned. This parameter is only used in application, session and session application scopes.
        Returns:
        The matching IWebScope or null if bCreateIfNotExisting is false and no scope is present
        Throws:
        IllegalArgumentException - If an illegal enumeration value is passed.