com.groiss.util
Class TransientWrapper

java.lang.Object
  extended by com.groiss.util.TransientWrapper

public class TransientWrapper
extends java.lang.Object

Provides a means to exclude serializable objects from serialization mechanisms by wrapping them.


Constructor Summary
TransientWrapper(java.lang.Object value)
          Wrap an object.
 
Method Summary
static java.lang.Object getAttribute(javax.servlet.http.HttpSession session, java.lang.String name)
          Gets the object bound with the specified name from an http session.
static void setAttribute(javax.servlet.http.HttpSession session, java.lang.String name, java.lang.Object value)
          Binds an object to a http session, using the name specified.
 java.lang.String toString()
           
 java.lang.Object unwrap()
          Unwrap a wrapped object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransientWrapper

public TransientWrapper(java.lang.Object value)
Wrap an object.

Parameters:
value -
Method Detail

unwrap

public java.lang.Object unwrap()
Unwrap a wrapped object

Returns:
the wrapped object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setAttribute

public static void setAttribute(javax.servlet.http.HttpSession session,
                                java.lang.String name,
                                java.lang.Object value)
Binds an object to a http session, using the name specified. If the object is not instance of TransientWrapper, it is first wrapped into a TransientWrapper.

Parameters:
session - a HTTPSession to bind the object to.
name - the name to which the object is bound; cannot be null
value - the object to be bound

getAttribute

public static java.lang.Object getAttribute(javax.servlet.http.HttpSession session,
                                            java.lang.String name)
Gets the object bound with the specified name from an http session. If the object is an instance of TransientWrapper, the object wrapped by it is returned, else the object itself is returned.

Parameters:
session - a HTTPSession where the object is bound
name - a string specifying the name of the object
Returns:
the object with the specified name


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.