ModelInitializer with managing model
attributes in the WebSession based on model attribute names and types
declared va @SessionAttributes.
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final Set | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public | SessionAttributesHandler(Class<?>
the controller type handlerType)Create a new session attributes handler. |
| Modifier and Type | Method and Description |
|---|---|
| public void | cleanupAttributes(WebSession
the current session session)Remove "known" attributes from the session, i.e. attributes listed
by name in |
| public boolean | hasSessionAttributes()
Whether the controller represented by this instance has declared any
session attributes through an |
| public boolean | isHandlerSessionAttribute(String
the attribute name to check attributeName, Class<?> the type for the attribute attributeType)Whether the attribute name or type match the names and types specified
via |
| public Map | Returns: a map with handler session attributes, possibly emptythe current session session)Retrieve "known" attributes from the session, i.e. attributes listed
by name in |
| public void | storeAttributes(WebSession
the current session session, Map<String, ?> candidate attributes for session storage attributes)Store a subset of the given attributes in the session. |
| attributeNames | back to summary |
|---|---|
| private final Set<String> attributeNames | |
| attributeTypes | back to summary |
|---|---|
| private final Set<Class<?>> attributeTypes | |
| knownAttributeNames | back to summary |
|---|---|
| private final Set<String> knownAttributeNames | |
| SessionAttributesHandler | back to summary |
|---|---|
| public SessionAttributesHandler(Class<?> handlerType) Create a new session attributes handler. Session attribute names and types
are extracted from the
| |
| cleanupAttributes | back to summary |
|---|---|
| public void cleanupAttributes(WebSession session) Remove "known" attributes from the session, i.e. attributes listed
by name in
| |
| hasSessionAttributes | back to summary |
|---|---|
| public boolean hasSessionAttributes() Whether the controller represented by this instance has declared any
session attributes through an | |
| isHandlerSessionAttribute | back to summary |
|---|---|
| public boolean isHandlerSessionAttribute(String attributeName, Class<?> attributeType) Whether the attribute name or type match the names and types specified
via Attributes successfully resolved through this method are "remembered"
and subsequently used in | |
| retrieveAttributes | back to summary |
|---|---|
| public Map Retrieve "known" attributes from the session, i.e. attributes listed
by name in
| |
| storeAttributes | back to summary |
|---|---|
| public void storeAttributes(WebSession session, Map<String, ?> attributes) Store a subset of the given attributes in the session. Attributes not
declared as session attributes via
| |