Package com.helger.web.scope.mgr
Enum EWebScope
- java.lang.Object
-
- java.lang.Enum<EWebScope>
-
- com.helger.web.scope.mgr.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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IWebScopegetScope()IWebScopegetScope(boolean bCreateIfNotExisting)Get the current web scope object of this enum entry.static IWebScopegetScope(EWebScope eWebScope, boolean bCreateIfNotExisting)Resolve the currently matching web scope of the givenEWebScopevalue.static EWebScopevalueOf(String name)Returns the enum constant of this type with the specified name.static EWebScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 nameNullPointerException- if the argument is null
-
getScope
@Nonnull public IWebScope getScope()
- Returns:
- The current
IWebScopeobject for this enum. Aequivalent togetScope(true)and therefore nevernull.
-
getScope
@Nullable public IWebScope getScope(boolean bCreateIfNotExisting)
Get the current web scope object of this enum entry.- Parameters:
bCreateIfNotExisting- iftruethe scope is created if it is not existing.- Returns:
nullif the scope is not existing yet and should not be created. Always non-nullif the parameter istrue.
-
getScope
@Nullable public static IWebScope getScope(@Nonnull EWebScope eWebScope, boolean bCreateIfNotExisting)
Resolve the currently matching web scope of the givenEWebScopevalue.- Parameters:
eWebScope- The web scope to resolve to a real scope. May not benull.bCreateIfNotExisting- iffalseand the scope is not existing,nullwill be returned. This parameter is only used in application, session and session application scopes.- Returns:
- The matching
IWebScopeornullif bCreateIfNotExisting isfalseand no scope is present - Throws:
IllegalArgumentException- If an illegal enumeration value is passed.
-
-