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> Tget(ServletContext servletContext, String name) Gets an application-scope attribute.Gets the application context for this attribute.static <T> TgetOrDefault(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 beclosedto 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.voidremove()Removes the value from this application-scope attribute.static voidremove(ServletContext servletContext, String name) Removes an application-scope attribute.static <T> booleanremove(ServletContext servletContext, String name, T value) Much likeMap.remove(java.lang.Object, java.lang.Object), but for an application-scope attribute.booleanMuch likeMap.remove(java.lang.Object, java.lang.Object), but for this application-scope attribute.static <T> Treplace(ServletContext servletContext, String name, T value) Much likeMap.replace(java.lang.Object, java.lang.Object), but for an application-scope attribute.static <T> booleanreplace(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.booleanMuch likeMap.replace(java.lang.Object, java.lang.Object, java.lang.Object), but for this application-scope attribute.static <T> voidset(ServletContext servletContext, String name, T value) Sets an application-scope attribute.voidSets the value of this application-scope attribute.static <T> TsetIfAbsent(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:
getContextin classAttributeEE<ServletContext,T>
-
init
Initializes this application-scope attribute, returning a backup value, which must beclosedto restore the old value. This is best used in try-with-resources.- Specified by:
initin 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 onservletContextto 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 onservletContextto ensure atomic operation.- Specified by:
computein 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 onservletContextto 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 onservletContextto ensure atomic operation.- Specified by:
computeIfAbsentin 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 onservletContextto 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 onservletContextto ensure atomic operation.- Specified by:
computeIfPresentin 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:
getin 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:
getOrDefaultin 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 onservletContextto 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 onservletContextto ensure atomic operation.- Specified by:
mergein 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:
removein classAttribute<ServletContext,T>
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object), but for an application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- See Also:
-
remove
Much likeMap.remove(java.lang.Object, java.lang.Object), but for this application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- Specified by:
removein classAttribute<ServletContext,T> - See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object), but for an application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- See Also:
-
replace
Much likeMap.replace(java.lang.Object, java.lang.Object), but for this application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- Specified by:
replacein 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 onservletContextto 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 onservletContextto ensure atomic operation.- Specified by:
replacein classAttribute<ServletContext,T> - See Also:
-
set
Sets an application-scope attribute. -
set
Sets the value of this application-scope attribute.- Specified by:
setin classAttribute<ServletContext,T>
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object), but for an application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- See Also:
-
setIfAbsent
Much likeMap.putIfAbsent(java.lang.Object, java.lang.Object), but for this application-scope attribute. Synchronizes onservletContextto ensure atomic operation.- Specified by:
setIfAbsentin classAttribute<ServletContext,T> - See Also:
-
