This project has retired. For details please refer to its Attic page.
BasicAttributeContext (Tiles 2 2.0.7 API)

org.apache.tiles.context
Class BasicAttributeContext

Package class diagram package BasicAttributeContext
java.lang.Object
  extended by org.apache.tiles.context.BasicAttributeContext
All Implemented Interfaces:
Serializable, AttributeContext

public class BasicAttributeContext
extends Object
implements AttributeContext, Serializable

Basic implementation for AttributeContext.

Version:
$Rev: 616498 $ $Date: 2008-01-29 20:40:35 +0100 (Tue, 29 Jan 2008) $
See Also:
Serialized Form

Constructor Summary
BasicAttributeContext()
          Constructor.
BasicAttributeContext(AttributeContext context)
          Copy constructor.
BasicAttributeContext(Map<String,Attribute> attributes)
          Constructor.
 
Method Summary
 void addAll(Map<String,Attribute> newAttributes)
          Add all attributes to this context.
 void addMissing(Map<String,Attribute> defaultAttributes)
          Add all missing attributes to this context.
 void clear()
          Clear the attributes.
 Attribute getAttribute(String name)
          Get an attribute from context.
 Iterator<String> getAttributeNames()
          Get names of all attributes.
static AttributeContext getContext(TilesRequestContext tilesContext)
          Deprecated. Use TilesContainer#getAttributeContext(Object...).
static Stack<AttributeContext> getContextStack(TilesRequestContext tilesContext)
          Deprecated. Use TilesContainer#getAttributeContext(Object...), TilesContainer#startContext(Object...) or TilesContainer#endContext(Object...).
static AttributeContext popContext(TilesRequestContext tilesContext)
          Deprecated. Use TilesContainer#endContext(Object...).
static void pushContext(AttributeContext context, TilesRequestContext tilesContext)
          Deprecated. Use TilesContainer#startContext(Object...).
 void putAttribute(String name, Attribute value)
          Put a new attribute to context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAttributeContext

public BasicAttributeContext()
Constructor.


BasicAttributeContext

public BasicAttributeContext(Map<String,Attribute> attributes)
Constructor. Create a context and set specified attributes.

Parameters:
attributes - Attributes to initialize context.

BasicAttributeContext

public BasicAttributeContext(AttributeContext context)
Copy constructor.

Parameters:
context - The constructor to copy.
Method Detail

addAll

public void addAll(Map<String,Attribute> newAttributes)
Add all attributes to this context. Copies all of the mappings from the specified attribute map to this context. New attribute mappings will replace any mappings that this context had for any of the keys currently in the specified attribute map.

Specified by:
addAll in interface AttributeContext
Parameters:
newAttributes - Attributes to add.

addMissing

public void addMissing(Map<String,Attribute> defaultAttributes)
Add all missing attributes to this context. Copies all of the mappings from the specified attributes map to this context. New attribute mappings will be added only if they don't already exist in this context.

Specified by:
addMissing in interface AttributeContext
Parameters:
defaultAttributes - Attributes to add.

getAttribute

public Attribute getAttribute(String name)
Get an attribute from context.

Specified by:
getAttribute in interface AttributeContext
Parameters:
name - Name of the attribute.
Returns:
<{Attribute}>

getAttributeNames

public Iterator<String> getAttributeNames()
Get names of all attributes.

Specified by:
getAttributeNames in interface AttributeContext
Returns:
<{Attribute}>

putAttribute

public void putAttribute(String name,
                         Attribute value)
Put a new attribute to context.

Specified by:
putAttribute in interface AttributeContext
Parameters:
name - Name of the attribute.
value - Value of the attribute.

getContext

@Deprecated
public static AttributeContext getContext(TilesRequestContext tilesContext)
Deprecated. Use TilesContainer#getAttributeContext(Object...).

Get attribute context from request.

Parameters:
tilesContext - current Tiles application context.
Returns:
BasicAttributeContext or null if context is not found or an jspException is present in the request.

getContextStack

@Deprecated
public static Stack<AttributeContext> getContextStack(TilesRequestContext tilesContext)
Deprecated. Use TilesContainer#getAttributeContext(Object...), TilesContainer#startContext(Object...) or TilesContainer#endContext(Object...).

Returns the context stack.

Parameters:
tilesContext - The Tiles context object to use.
Returns:
The needed stack of contexts.

pushContext

@Deprecated
public static void pushContext(AttributeContext context,
                                          TilesRequestContext tilesContext)
Deprecated. Use TilesContainer#startContext(Object...).

Pushes a context object in the stack.

Parameters:
context - The context to push.
tilesContext - The Tiles context object to use.

popContext

public static AttributeContext popContext(TilesRequestContext tilesContext)
Deprecated. Use TilesContainer#endContext(Object...).

Pops a context object out of the stack.

Parameters:
tilesContext - The Tiles context object to use.
Returns:
The popped context object.

clear

public void clear()
Clear the attributes.

Specified by:
clear in interface AttributeContext


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.