public class VaadinServletContext extends Object implements VaadinContext
VaadinContext that goes with VaadinServletService.| Constructor and Description |
|---|
VaadinServletContext(javax.servlet.ServletContext context)
Creates an instance of this context with given
ServletContext. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getAttribute(Class<T> type,
Supplier<T> defaultValueSupplier)
Returns value of the specified attribute, creating a default value if not
present.
|
javax.servlet.ServletContext |
getContext()
Returns the underlying context.
|
String |
getContextParameter(String name)
Returns the value for the requested parameter, or
null if
the parameter does not exist. |
Enumeration<String> |
getContextParameterNames()
Returns the names of the initialization parameters as an
Enumeration, or an empty Enumeration if there
are o initialization parameters. |
void |
removeAttribute(Class<?> clazz)
Removes an attribute identified by the given type.
|
<T> void |
setAttribute(Class<T> clazz,
T value)
Sets the attribute value for the give type, overriding previously
existing one.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, setAttributepublic VaadinServletContext(javax.servlet.ServletContext context)
ServletContext.context - the servlet context to usepublic javax.servlet.ServletContext getContext()
ServletContext.public <T> T getAttribute(Class<T> type, Supplier<T> defaultValueSupplier)
VaadinContextgetAttribute in interface VaadinContexttype - Type of the attribute.defaultValueSupplier - Supplier of the default value, called when there is no
value already present. May be null.public <T> void setAttribute(Class<T> clazz, T value)
VaadinContextsetAttribute in interface VaadinContextclazz - the type to associate the value with, not nullvalue - the attribute value to set, or null to remove the
current valuepublic void removeAttribute(Class<?> clazz)
VaadinContextremoveAttribute in interface VaadinContextclazz - Attribute type.for setting attributes.public Enumeration<String> getContextParameterNames()
VaadinContextEnumeration, or an empty Enumeration if there
are o initialization parameters.getContextParameterNames in interface VaadinContextEnumerationpublic String getContextParameter(String name)
VaadinContextnull if
the parameter does not exist.getContextParameter in interface VaadinContextname - name of the parameter whose value is requestedString or null for
no parameterCopyright © 2021. All rights reserved.