org.ujac.util.template
Class TemplateContext

java.lang.Object
  extended by org.ujac.util.exi.ExpressionContext
      extended by org.ujac.util.template.TemplateContext
All Implemented Interfaces:
Serializable, Map

public class TemplateContext
extends ExpressionContext

Name: TemplateContext
Description: A class holding all relevant data, needed to execute templates.

Author:
lauerc
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
TemplateContext(Map properties)
          Constructs a TemplateContext instance with specific attributes.
TemplateContext(Map properties, FormatHelper formatHelper)
          Constructs a TemplateContext instance with specific attributes.
TemplateContext(Map properties, Object bean, FormatHelper formatHelper)
          Constructs a ExpressionContext instance with specific attributes.
TemplateContext(TemplateContext ctx)
          Constructs a TemplateContext instance with specific attributes.
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 Object get(Object key)
           
 Object getProperty(Object name)
          Gets a property from the property map.
 boolean isEmpty()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 Object remove(Object key)
           
 void setGlobalProperty(Object name, Object value)
          Setter method for the the property localData.
 Object setProperty(Object name, Object value)
          Setter method for the the property localData.
 int size()
           
 Collection values()
           
 
Methods inherited from class org.ujac.util.exi.ExpressionContext
getBean, getFormatHelper, putAll, readData, setBean, setFormatHelper, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

TemplateContext

public TemplateContext(Map properties)
Constructs a TemplateContext instance with specific attributes.

Parameters:
properties - The properties to use for expression evaluation.

TemplateContext

public TemplateContext(Map properties,
                       FormatHelper formatHelper)
Constructs a TemplateContext instance with specific attributes.

Parameters:
properties - The properties to use for expression evaluation.
formatHelper - The format helper to use.

TemplateContext

public TemplateContext(Map properties,
                       Object bean,
                       FormatHelper formatHelper)
Constructs a ExpressionContext instance with specific attributes.

Parameters:
properties - The properties to use for expression evaluation.
bean - The bean used to retrieve parameter values, if the parameter value didn't exist in the localData map.
formatHelper - The format helper to use.

TemplateContext

public TemplateContext(TemplateContext ctx)
Constructs a TemplateContext instance with specific attributes.

Parameters:
ctx - The context to clone.
Method Detail

getProperty

public Object getProperty(Object name)
Gets a property from the property map.

Overrides:
getProperty in class ExpressionContext
Parameters:
name - The property name.
Returns:
The value of the desired property or null.

setProperty

public Object setProperty(Object name,
                          Object value)
Setter method for the the property localData.

Overrides:
setProperty in class ExpressionContext
Parameters:
name - The property name.
value - The value to set.
Returns:
The old value of the property to set.

setGlobalProperty

public void setGlobalProperty(Object name,
                              Object value)
Setter method for the the property localData.

Parameters:
name - The property name.
value - The value to set.

size

public int size()
Specified by:
size in interface Map
Overrides:
size in class ExpressionContext
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map
Overrides:
isEmpty in class ExpressionContext
See Also:
Map.isEmpty()

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map
Overrides:
containsKey in class ExpressionContext
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map
Overrides:
containsValue in class ExpressionContext
See Also:
Map.containsValue(java.lang.Object)

get

public Object get(Object key)
Specified by:
get in interface Map
Overrides:
get in class ExpressionContext
See Also:
Map.get(java.lang.Object)

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map
Overrides:
put in class ExpressionContext
See Also:
Map.put(java.lang.Object, java.lang.Object)

remove

public Object remove(Object key)
Specified by:
remove in interface Map
Overrides:
remove in class ExpressionContext
See Also:
Map.remove(java.lang.Object)

clear

public void clear()
Specified by:
clear in interface Map
Overrides:
clear in class ExpressionContext
See Also:
Map.clear()

keySet

public Set keySet()
Specified by:
keySet in interface Map
Overrides:
keySet in class ExpressionContext
See Also:
Map.keySet()

values

public Collection values()
Specified by:
values in interface Map
Overrides:
values in class ExpressionContext
See Also:
Map.values()

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Overrides:
entrySet in class ExpressionContext
See Also:
Map.entrySet()


Copyright © 2003-2004 UJAC.org. All Rights Reserved.