Module com.aoapps.servlet.util
Package com.aoapps.servlet.attribute
Class AttributeEE.Application<T>
java.lang.Object
com.aoapps.lang.attribute.Attribute<ServletContext,T>
com.aoapps.servlet.attribute.AttributeEE<ServletContext,T>
com.aoapps.servlet.attribute.AttributeEE.Application<T>
- Enclosing class:
AttributeEE<C,
T>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.aoapps.servlet.attribute.AttributeEE
AttributeEE.Application<T>, AttributeEE.Jstl<T>, AttributeEE.Name<T>, AttributeEE.Page<T>, AttributeEE.Request<T>, AttributeEE.Session<T>
Nested classes/interfaces inherited from class com.aoapps.lang.attribute.Attribute
Attribute.OldValue
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompute
(BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute.static <T,
Ex extends Throwable>
Tcompute
(ServletContext servletContext, String name, BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for an application-scope attribute.computeIfAbsent
(FunctionE<? super String, ? extends T, ? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for this application-scope attribute.static <T,
Ex extends Throwable>
TcomputeIfAbsent
(ServletContext servletContext, String name, FunctionE<? super String, ? extends T, ? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for an application-scope attribute.computeIfPresent
(BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute.static <T,
Ex extends Throwable>
TcomputeIfPresent
(ServletContext servletContext, String name, BiFunctionE<? super String, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for an application-scope attribute.get()
Gets the value of this application-scope attribute.static <T> T
get
(ServletContext servletContext, String name) Gets an application-scope attribute.Gets the application context for this attribute.static <T> T
getOrDefault
(ServletContext servletContext, String name, T defaultValue) Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for an application-scope attribute.getOrDefault
(T defaultValue) Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for this application-scope attribute.Initializes this application-scope attribute, returning a backup value, which must beclosed
to restore the old value.static <T,
Ex extends Throwable>
Tmerge
(ServletContext servletContext, String name, T value, BiFunctionE<? super T, ? super T, ? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute.void
remove()
Removes the value from this application-scope attribute.static void
remove
(ServletContext servletContext, String name) Removes an application-scope attribute.static <T> boolean
remove
(ServletContext servletContext, String name, T value) Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for an application-scope attribute.boolean
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for this application-scope attribute.static <T> T
replace
(ServletContext servletContext, String name, T value) Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for an application-scope attribute.static <T> boolean
replace
(ServletContext servletContext, String name, T oldValue, T newValue) Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for an application-scope attribute.Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for this application-scope attribute.boolean
Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for this application-scope attribute.static <T> void
set
(ServletContext servletContext, String name, T value) Sets an application-scope attribute.void
Sets the value of this application-scope attribute.static <T> T
setIfAbsent
(ServletContext servletContext, String name, T value) Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for an application-scope attribute.setIfAbsent
(T value) Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for this application-scope attribute.Methods inherited from class com.aoapps.servlet.attribute.AttributeEE
attribute, jstl
-
Method Details
-
getContext
Gets the application context for this attribute.- Specified by:
getContext
in classAttributeEE<ServletContext,
T>
-
init
Initializes this application-scope attribute, returning a backup value, which must beclosed
to restore the old value. This is best used in try-with-resources.- Specified by:
init
in classAttribute<ServletContext,
T>
-
compute
public static <T,Ex extends Throwable> T compute(ServletContext servletContext, String name, BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Throws:
Ex
- See Also:
-
compute
public <Ex extends Throwable> T compute(BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.compute(java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
compute
in classAttribute<ServletContext,
T> - Throws:
Ex
- See Also:
-
computeIfAbsent
public static <T,Ex extends Throwable> T computeIfAbsent(ServletContext servletContext, String name, FunctionE<? super String, ? extends T, throws Ex? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Throws:
Ex
- See Also:
-
computeIfAbsent
public <Ex extends Throwable> T computeIfAbsent(FunctionE<? super String, ? extends T, throws Ex? extends Ex> mappingFunction) Much likeMap.computeIfAbsent(java.lang.Object, java.util.function.Function)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
computeIfAbsent
in classAttribute<ServletContext,
T> - Throws:
Ex
- See Also:
-
computeIfPresent
public static <T,Ex extends Throwable> T computeIfPresent(ServletContext servletContext, String name, BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Throws:
Ex
- See Also:
-
computeIfPresent
public <Ex extends Throwable> T computeIfPresent(BiFunctionE<? super String, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.computeIfPresent(java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
computeIfPresent
in classAttribute<ServletContext,
T> - Throws:
Ex
- See Also:
-
get
Gets an application-scope attribute.- Parameters:
servletContext
- may benull
, which will returnnull
-
get
Gets the value of this application-scope attribute.- Specified by:
get
in classAttribute<ServletContext,
T>
-
getOrDefault
Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for an application-scope attribute.- Parameters:
servletContext
- may benull
, which will returndefaultValue
- See Also:
-
getOrDefault
Much likeMap.getOrDefault(java.lang.Object, java.lang.Object)
, but for this application-scope attribute.- Specified by:
getOrDefault
in classAttribute<ServletContext,
T> - See Also:
-
merge
public static <T,Ex extends Throwable> T merge(ServletContext servletContext, String name, T value, BiFunctionE<? super T, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Throws:
Ex
- See Also:
-
merge
public <Ex extends Throwable> T merge(T value, BiFunctionE<? super T, ? super T, throws Ex? extends T, ? extends Ex> remappingFunction) Much likeMap.merge(java.lang.Object, java.lang.Object, java.util.function.BiFunction)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
merge
in classAttribute<ServletContext,
T> - Throws:
Ex
- See Also:
-
remove
Removes an application-scope attribute.- Parameters:
servletContext
- may benull
, which will skip removal
-
remove
public void remove()Removes the value from this application-scope attribute.- Specified by:
remove
in classAttribute<ServletContext,
T>
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- See Also:
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
remove
in classAttribute<ServletContext,
T> - See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
replace
in classAttribute<ServletContext,
T> - See Also:
-
replace
public static <T> boolean replace(ServletContext servletContext, String name, T oldValue, T newValue) Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
replace
in classAttribute<ServletContext,
T> - See Also:
-
set
Sets an application-scope attribute. -
set
Sets the value of this application-scope attribute.- Specified by:
set
in classAttribute<ServletContext,
T>
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for an application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- See Also:
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object)
, but for this application-scope attribute. Synchronizes onservletContext
to ensure atomic operation.- Specified by:
setIfAbsent
in classAttribute<ServletContext,
T> - See Also:
-