nl.imsystems.atag.servlet
Class ATagContext

java.lang.Object
  extended by nl.imsystems.atag.servlet.ATagContext

public class ATagContext
extends Object

This class provides definition tags with information about the refering reference.

An ATagContext instance is initially created and populated by ATagFiler using values from the request, and consequently by reference tags prior to including the content of thier target.

Each reference tag creates and populate an instance of ATagContext using attribute values entered on the tag itself, and pushes it on the request before 'including' its target, making its context available to the underlying component or panel.

Author:
kayvan


Method Summary
 String getBindPath()
          Returns the bind attribute assigned to the reference that this context represents.
 String getFullViewUrl()
          Returns the view url resolved using the viewPrefix and viewSuffix configuration parameters.
 ATagContext getInitialContext()
          Returns the first context created during the scope of this request.
 String getParamName()
          Returns the paramName attribute assigned to the reference that this context represents.
 Properties getParams()
          Returns a Properties instance populated with custom params added to the reference that this context represents.
 String getRefId()
          Returns the full id of the reference that this context represents.
 String getType()
          Returns the type of component the associated reference is refering to.
 String getViewPrefix()
          Returns the viewPrefix configuration parameter
 String getViewSuffix()
          Returns the viewSuffix configuration parameter
 String getViewUrl()
          Returns the viewUrl attribute assigned to the reference that this context represents.
 boolean isInitial()
          Returns true if this context is the first context created during the scope of this request.
 boolean isRender()
          Returns the render attribute assigned to the reference that this context represents.
static ATagContext newInstance(ATagContext current)
          Creates an instance of ATagContext given the current context.
 void putAllParams(Map params)
          Populates the custom params using values in the Map.
 void setBindPath(String bindPath)
          Sets the bind value.
 void setInitialContext(ATagContext initialContext)
          Sets theinitial context value
 void setParamName(String paramName)
          Sets the param name value.
 void setRefId(String refId)
          Set the full id value
 void setRender(boolean render)
          Sets the render value
 void setType(String type)
          Sets the type value
 void setViewPrefix(String viewPrefix)
          Sets the viewPrefix configuration parameter.
 void setViewSuffix(String viewSuffix)
          Sets the viewSuffix configuration parameter.
 void setViewUrl(String viewUrl)
          Sets the viewUrl attribute.
 String toString()
          Debug info
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBindPath

public String getBindPath()
Returns the bind attribute assigned to the reference that this context represents.

Returns:
The bind value;

setBindPath

public void setBindPath(String bindPath)
Sets the bind value.

Parameters:
bindPath - The bind value

getParamName

public String getParamName()
Returns the paramName attribute assigned to the reference that this context represents.

Returns:
The paramName value.

setParamName

public void setParamName(String paramName)
Sets the param name value.

Parameters:
paramName - The paramName value

getParams

public Properties getParams()
Returns a Properties instance populated with custom params added to the reference that this context represents.

Returns:
Properties populated with params, or an empty Properties if none where added

getRefId

public String getRefId()
Returns the full id of the reference that this context represents. This is the id attribute assigned to the reference tag, plus its namespace prefix derived from its position within in the ATag component hierarchy

Returns:
The full id of the reference

setRefId

public void setRefId(String refId)
Set the full id value

Parameters:
refId - The full id to set

isRender

public boolean isRender()
Returns the render attribute assigned to the reference that this context represents. When set to false the target component will not be rendered.

Returns:
true if the component should be rendered

setRender

public void setRender(boolean render)
Sets the render value

Parameters:
render - The value to set

getViewUrl

public String getViewUrl()
Returns the viewUrl attribute assigned to the reference that this context represents. This is the plain unresovled viewUrl attribute.

Returns:
The viewUrl value

getFullViewUrl

public String getFullViewUrl()
Returns the view url resolved using the viewPrefix and viewSuffix configuration parameters.

Returns:
The full view url relative to app context

setViewUrl

public void setViewUrl(String viewUrl)
Sets the viewUrl attribute.

Parameters:
viewUrl - The value to set

putAllParams

public void putAllParams(Map params)
Populates the custom params using values in the Map.

Parameters:
params - Values to use.

getType

public String getType()
Returns the type of component the associated reference is refering to. This coul be either a panel or a component.

Returns:
'panel' or 'comp'

setType

public void setType(String type)
Sets the type value

Parameters:
type - Value to set.

setViewPrefix

public void setViewPrefix(String viewPrefix)
Sets the viewPrefix configuration parameter.

Parameters:
viewPrefix - The value to set

setViewSuffix

public void setViewSuffix(String viewSuffix)
Sets the viewSuffix configuration parameter.

Parameters:
viewSuffix - The value to set

getViewPrefix

public String getViewPrefix()
Returns the viewPrefix configuration parameter

Returns:
viewPrefix value

getViewSuffix

public String getViewSuffix()
Returns the viewSuffix configuration parameter

Returns:
viewSuffix value

isInitial

public boolean isInitial()
Returns true if this context is the first context created during the scope of this request.

Returns:
true if initial

getInitialContext

public ATagContext getInitialContext()
Returns the first context created during the scope of this request.

Returns:
The initial context

setInitialContext

public void setInitialContext(ATagContext initialContext)
Sets theinitial context value

Parameters:
initialContext - The value to set

newInstance

public static ATagContext newInstance(ATagContext current)
Creates an instance of ATagContext given the current context.

Parameters:
current - The current ATagContext
Returns:
New instance of ATagContext

toString

public String toString()
Debug info

Overrides:
toString in class Object