Package org.apache.turbine.util.template
Class TemplateInfo
- java.lang.Object
-
- org.apache.turbine.util.template.TemplateInfo
-
public class TemplateInfo extends Object
This is a wrapper for Template specific information. It's part of the RunData object and can extract the information it needs to do the job directly from the data.getParameters().- Version:
- $Id$
- Author:
- Dave Bryson, Jason van Zyl, Henning P. Schmiedehausen
-
-
Field Summary
Fields Modifier and Type Field Description static StringLAYOUT_TEMPLATEConstants for tempStorage hash map.static StringNAVIGATION_TEMPLATEConstants for tempStorage hash map.static StringSERVICE_NAMEConstants for tempStorage hash map.
-
Constructor Summary
Constructors Constructor Description TemplateInfo(RunData data)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetLayoutTemplate()Get the value of layout.StringgetNavigationTemplate()Get the value of navigationTemplate.StringgetScreenTemplate()Get the value of screen for the RunData parameters.StringgetService()Get the value of service.StringgetString(String name)Return a String from the temp hash map.String[]getStringArray(String name)Return a String[] from the temp hash map.ObjectgetTemp(String name)Get an object from temporary storage.ObjectgetTemp(String name, Object def)Get an object from temporary storage, or a default value.Object[]getTempKeys()Returns all the available names in the temporary storage.ObjectgetTemplateContext(String name)Get the value of Template context.ObjectremoveTemp(String name)Remove an object from the temporary storage.voidsetLayoutTemplate(String v)Set the value of layout.voidsetNavigationTemplate(String v)Set the value of navigationTemplate.voidsetScreenTemplate(String v)Set the value of screen.voidsetService(String v)Set the value of service.voidsetTemp(String name, Object value)Put an object into temporary storage.voidsetTemplateContext(String name, Object v)Set the value of context.
-
-
-
Field Detail
-
NAVIGATION_TEMPLATE
public static final String NAVIGATION_TEMPLATE
Constants for tempStorage hash map.- See Also:
- Constant Field Values
-
LAYOUT_TEMPLATE
public static final String LAYOUT_TEMPLATE
Constants for tempStorage hash map.- See Also:
- Constant Field Values
-
SERVICE_NAME
public static final String SERVICE_NAME
Constants for tempStorage hash map.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TemplateInfo
public TemplateInfo(RunData data)
Constructor- Parameters:
data- A Turbine RunData object.
-
-
Method Detail
-
getNavigationTemplate
public String getNavigationTemplate()
Get the value of navigationTemplate.- Returns:
- A String with the value of navigationTemplate.
-
setNavigationTemplate
public void setNavigationTemplate(String v)
Set the value of navigationTemplate.- Parameters:
v- Value to assign to navigationTemplate.
-
getScreenTemplate
public String getScreenTemplate()
Get the value of screen for the RunData parameters. This information comes from PathInfo or a QueryString.- Returns:
- A String with the value of screen.
-
setScreenTemplate
public void setScreenTemplate(String v)
Set the value of screen. This is really just a method to hide using the RunData Parameter.- Parameters:
v- Value to assign to screen.
-
getLayoutTemplate
public String getLayoutTemplate()
Get the value of layout.- Returns:
- A String with the value of layout.
-
setLayoutTemplate
public void setLayoutTemplate(String v)
Set the value of layout.- Parameters:
v- Value to assign to layout.
-
getTemplateContext
public Object getTemplateContext(String name)
Get the value of Template context. This will be cast to the proper Context by its Service.- Parameters:
name- The name of the template context.- Returns:
- An Object with the Value of context.
-
setTemplateContext
public void setTemplateContext(String name, Object v)
Set the value of context.- Parameters:
name- The name of the template context.v- Value to assign to context.
-
getService
public String getService()
Get the value of service.- Returns:
- A String with the value of service.
-
setService
public void setService(String v)
Set the value of service.- Parameters:
v- Value to assign to service.
-
getTemp
public Object getTemp(String name)
Get an object from temporary storage.- Parameters:
name- A String with the name of the object.- Returns:
- An Object.
-
getTemp
public Object getTemp(String name, Object def)
Get an object from temporary storage, or a default value.- Parameters:
name- A String with the name of the object.def- An Object, the default value.- Returns:
- An Object.
-
setTemp
public void setTemp(String name, Object value)
Put an object into temporary storage.- Parameters:
name- A String with the name of the object.value- An Object, the value.
-
getStringArray
public String[] getStringArray(String name)
Return a String[] from the temp hash map.- Parameters:
name- A String with the name of the object.- Returns:
- A String[].
-
getString
public String getString(String name)
Return a String from the temp hash map.- Parameters:
name- A String with the name of the object.- Returns:
- A String.
-
removeTemp
public Object removeTemp(String name)
Remove an object from the temporary storage.- Parameters:
name- A String with the name of the object.- Returns:
- The object that was removed or
nullif the name was not a key.
-
getTempKeys
public Object[] getTempKeys()
Returns all the available names in the temporary storage.- Returns:
- A object array with the keys.
-
-