it.eng.spagobi.container
Class AbstractContainer

java.lang.Object
  extended by it.eng.spagobi.container.AbstractContainer
All Implemented Interfaces:
IContainer
Direct Known Subclasses:
ContextManager, SpagoBIRequestContainer, SpagoBISessionContainer

public abstract class AbstractContainer
extends java.lang.Object
implements IContainer

Abstract class that implements all it.eng.spagobi.container.IContainer methods apart from get/set/remove/getKeys methods. All other methods are implemented starting from abstract set and get methods. This class provides implementation for standard objects cast and conversion such as String, Boolean, Integer.

Author:
Zerbetto (davide.zerbetto@eng.it)

Constructor Summary
AbstractContainer()
           
 
Method Summary
 BIObject getBIObject(java.lang.String key)
          TO BE USED ONLY INSIDE SPAGOBI CORE, NOT INSIDE EXTERNAL ENGINES.
 java.lang.Boolean getBoolean(java.lang.String key)
          If the key has no objects associated, null is returned.
 ExecutionInstance getExecutionInstance(java.lang.String key)
          TO BE USED ONLY INSIDE SPAGOBI CORE, NOT INSIDE EXTERNAL ENGINES.
 java.lang.Integer getInteger(java.lang.String key)
          If the key has no objects associated, null is returned.
 java.util.List getList(java.lang.String key)
          Return the List associated with the input key.
 java.lang.String getString(java.lang.String key)
          Returns the string representation of the object with the given key; if the key has no objects associated, null is returned
 boolean isBlankOrNull(java.lang.String key)
          Returns true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise
 boolean isNull(java.lang.String key)
          Returns true if no objects are stored into the container with the input key, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.eng.spagobi.container.IContainer
get, getKeys, remove, set
 

Constructor Detail

AbstractContainer

public AbstractContainer()
Method Detail

isNull

public boolean isNull(java.lang.String key)
Returns true if no objects are stored into the container with the input key, false otherwise

Specified by:
isNull in interface IContainer
Parameters:
key - The input key
Returns:
true if no objects are stored into the container with the input key, false otherwise

isBlankOrNull

public boolean isBlankOrNull(java.lang.String key)
Returns true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise

Specified by:
isBlankOrNull in interface IContainer
Parameters:
key - The input key
Returns:
true true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise

getString

public java.lang.String getString(java.lang.String key)
Returns the string representation of the object with the given key; if the key has no objects associated, null is returned

Specified by:
getString in interface IContainer
Parameters:
key - The input key
Returns:
the string representation of the object with the given key; if the key has no objects associated, null is returned

getBoolean

public java.lang.Boolean getBoolean(java.lang.String key)
If the key has no objects associated, null is returned. If a Boolean object is associated to that key, this Boolean is returned. Otherwise the string representation of the object is parsed with Boolean.parseBoolean(string); and the result is returned.

Specified by:
getBoolean in interface IContainer
Parameters:
key - The input key
Returns:
If the key has no objects associated, null is returned. If a Boolean object is associated to that key, this boolean is returned. Otherwise the string representation of the object is parsed with Boolean.parseBoolean(string); and the result is returned.

getInteger

public java.lang.Integer getInteger(java.lang.String key)
If the key has no objects associated, null is returned. If a Integer object is associated to that key, this Integer is returned. Otherwise the string representation of the object is parsed with Integer.parseInt(string); and the result is returned.

Specified by:
getInteger in interface IContainer
Parameters:
key - The input key
Returns:
If the key has no objects associated, null is returned. If a Integer object is associated to that key, this Integer is returned. Otherwise the string representation of the object is parsed with Integer.parseInt(string); and the result is returned.

getBIObject

public BIObject getBIObject(java.lang.String key)
TO BE USED ONLY INSIDE SPAGOBI CORE, NOT INSIDE EXTERNAL ENGINES. Return the BIObject associated with the input key. If the key is associated to an object that is not a BIObject instance, a ClassCastException is thrown.

Parameters:
key - The input key
Returns:
the BIObject associated with the input key.

getExecutionInstance

public ExecutionInstance getExecutionInstance(java.lang.String key)
TO BE USED ONLY INSIDE SPAGOBI CORE, NOT INSIDE EXTERNAL ENGINES. Return the ExecutionInstance associated with the input key. If the key is associated to an object that is not a ExecutionInstance instance, a ClassCastException is thrown.

Parameters:
key - The input key
Returns:
the ExecutionInstance associated with the input key.

getList

public java.util.List getList(java.lang.String key)
Return the List associated with the input key. If the key is associated to an object that is not a List instance, a ClassCastException is thrown.

Specified by:
getList in interface IContainer
Parameters:
key - The input key
Returns:
the List associated with the input key.