com.sas.taglib.servlet.tbeans
Class BaseTransformationTag

com.sas.taglib.servlet.tbeans.BaseTransformationTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
Direct Known Subclasses:
BaseActionTransformationTag, BaseFormElementTag, CellContentsEditorTag, CellContentsRendererTag, IFormHiddenTag, SelectorMenuItemTag

public abstract class BaseTransformationTag

The base object for all tag handlers in the SAS Custom Tag Library that are used as wrappers for TransformationBeans.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_CLIENT_INFO_INSTANCE
          Static String reference of the default ClientInfo instance to be used in the PageContext.
static java.lang.String HDML
          Static String reference of the "hdml" render type.
static java.lang.String HTML
          Static String reference of the "html" render type.
static java.lang.String WML
          Static String reference of the "wml" render type.
 
Fields inherited from class com.sas.taglib.BaseTag
APPLICATION, PAGE, RB_KEY, REQUEST, SESSION
 
Constructor Summary
BaseTransformationTag()
          Default constructor
 
Method Summary
protected  void applyAttributes()
          Sets the basic attributes (request,name,prolog,epilog) common to all Transformation Beans.
 int doEndTag()
          This Method Overrides the javax.servlet.jsp.tagext.TagSupport doEndTag Method.
 int doStartTag()
          This Method Overrides the javax.servlet.jsp.tagext.TagSupport doStartTag Method.
 java.lang.String getCustomAttributes()
          Gets the customAttributes attribute (String) for a custom tag.
 java.lang.String getEpilog()
          Returns the epilog if specified, otherwise null.
 java.util.Locale getLocale()
          Get the locale
 java.lang.String getName()
          Returns the name for the custom tag
 java.lang.String getObjectDataProperty()
          Get the objectDataProperty String.
 java.lang.String getProlog()
          Returns the prolog if specified, otherwise null.
 boolean getRender()
          Returns true if the custom tag should render it's information immediately, or false otherwise.
 java.lang.String getRenderType()
          Gets the render type property for the custom tag.
protected  void initialize(boolean includeAttributes)
          Initializes attributes and variables for this tag handler.
 void setCustomAttributes(java.lang.String customAttributes)
          Sets the customAttributes attribute (String) for a custom tag.
 void setEpilog(java.lang.String epilog)
          Sets the epilog attribute (String) for a custom tag.
 void setLocale(java.util.Locale locale)
          Set the locale
 void setName(java.lang.String name)
          Sets the name attribute for a custom tag.
 void setObjectDataProperty(java.lang.String property)
          Set the String that is used as the value of the ObjectData attribute.
 void setProlog(java.lang.String prolog)
          Sets the prolog attribute (String) for a custom tag.
 void setRender(boolean render)
          Sets the render property (boolean) from a tag attribute.
 void setRenderType(java.lang.String renderType)
          Sets the rendertype property (String) from a tag attribute.
 
Methods inherited from class com.sas.taglib.BaseTag
convertScope, doCatch, doFinally, getApplyAttributes, getComponentFromParentComposite, getCompositeComponentKey, getInstantiate, getPageContext, getRef, getScope, getTagScope, getWrappedClassName, getWrappedObject, getWrappedObject, loadBeanInstance, newInstance, release, removeFromScope, searchContext, setApplyAttributes, setComponentOnParentComposite, setCompositeComponentKey, setInstantiate, setRef, setScope, setTagScope, setVariableWithinScope, setWrappedClassName, setWrappedObject, validate
 

Field Detail

DEFAULT_CLIENT_INFO_INSTANCE

public static final java.lang.String DEFAULT_CLIENT_INFO_INSTANCE
Static String reference of the default ClientInfo instance to be used in the PageContext.

See Also:
Constant Field Values

HTML

public static final java.lang.String HTML
Static String reference of the "html" render type.

See Also:
Constant Field Values

HDML

public static final java.lang.String HDML
Static String reference of the "hdml" render type.

See Also:
Constant Field Values

WML

public static final java.lang.String WML
Static String reference of the "wml" render type.

See Also:
Constant Field Values
Constructor Detail

BaseTransformationTag

public BaseTransformationTag()
Default constructor

Method Detail

setCustomAttributes

public void setCustomAttributes(java.lang.String customAttributes)
Sets the customAttributes attribute (String) for a custom tag. The customAttributes attribute allows a user to add attributes to the resulting transformation bean output that extends the html/xml/wml or other rendering language specification.

Parameters:
customAttributes - a list of attributes in the form of attribute="value", space delimited

setEpilog

public void setEpilog(java.lang.String epilog)
Sets the epilog attribute (String) for a custom tag. The epilog is a text string that is output (or rendered) immediately following the last markup tag generated by the TransformationBean.

Parameters:
epilog - Text that is output immediately after the last markup tag.

setName

public void setName(java.lang.String name)
Sets the name attribute for a custom tag. The name is the value assigned to the name attribute of the underlying markup tag. The name String specifies the HTML or WML name of the component.

Note: If a name is not specified, then id will be used if available.

Parameters:
name - Value assigned to the markup tag's name attribute.

setProlog

public void setProlog(java.lang.String prolog)
Sets the prolog attribute (String) for a custom tag. The prolog is a text string that is output (or rendered) immediately preceeding the first markup tag generated by the TransformationBean.

Parameters:
prolog - Text that is output immediately preceeding the first markup tag.

setRender

public void setRender(boolean render)
Sets the render property (boolean) from a tag attribute. The render String specifies whether the Transformation Bean should be rendered at the end of the custom tag or not. This method also sets the visible property on the underlying TransformationBean. There are two ways to render the tag at a later time:
1. Render the object using the REF attribute
Create the Tag
<sas:checkbox id="cb" name="color" value="blue" label="blue" render="false"/>
Render the Tag later in the page
<sas:checkbox ref="cb" />
2. Render the object manually
Create the Tag
<sas:checkbox id="cb" name="color" value="blue" label="blue" render="false"/>
Render the transformation bean
<% cb.write(out); %>
Valid values are true or false.

Parameters:
render - Flag that, if true, indicates that the complete markup of the bean is output when the tag is closed. It also sets the the visible property on the underlying TransformationBean.

setRenderType

public void setRenderType(java.lang.String renderType)
Sets the rendertype property (String) from a tag attribute. The rendertype String determines which Transformation Bean to initialize.
Valid values are html, wml, hdml.

Parameters:
rendertype - Type of markup for the output tag(s).

setObjectDataProperty

public void setObjectDataProperty(java.lang.String property)
Set the String that is used as the value of the ObjectData attribute.

Parameters:
property - Value assigned to the output tag's objectDataProperty attribute.

setLocale

public void setLocale(java.util.Locale locale)
Set the locale

Overrides:
setLocale in class BaseTag
Parameters:
locale - Specifies the locale to use for this instance of the class.

getCustomAttributes

public java.lang.String getCustomAttributes()
Gets the customAttributes attribute (String) for a custom tag. The customAttributes attribute allows a user to add attributes to the resulting transformation bean output that extends the html/xml/wml or other rendering language specification.

Returns:
String a list of attributes in the form of attribute="value", space delimited

getEpilog

public java.lang.String getEpilog()
Returns the epilog if specified, otherwise null.

Returns:
String the epilog

getName

public java.lang.String getName()
Returns the name for the custom tag

Returns:
String the name of the custom tag

getProlog

public java.lang.String getProlog()
Returns the prolog if specified, otherwise null.

Returns:
int the PageContext scope of the custom tag

getRender

public boolean getRender()
Returns true if the custom tag should render it's information immediately, or false otherwise.

Returns:
boolean true if the custom tag should render itself automatically

getRenderType

public java.lang.String getRenderType()
Gets the render type property for the custom tag. First, an attempt is made to determine the render type based on the browser property from the servlet request object. This information can be specified through the ClientInfo Custom Tag, or automatically. The ClientInfo tag allows you to override browser information for testing and/or tweaking. If the renderType is specified through the setRendertype method, then it will override everything else. If all else fails, render type will default to "html"

Returns:
String the render type for the transformation bean

getObjectDataProperty

public java.lang.String getObjectDataProperty()
Get the objectDataProperty String.

Returns:
The objectDataProperty to be used or null if not set

getLocale

public java.util.Locale getLocale()
Get the locale

Overrides:
getLocale in class BaseTag
Returns:
The Locale object

initialize

protected void initialize(boolean includeAttributes)
Initializes attributes and variables for this tag handler.

Overrides:
initialize in class BaseTag
Parameters:
includeAttributes - Set to true if attributes are to be set to default values.

applyAttributes

protected void applyAttributes()
                        throws javax.servlet.jsp.JspException
Sets the basic attributes (request,name,prolog,epilog) common to all Transformation Beans.

Overrides:
applyAttributes in class BaseTag
Parameters:
baseTag - Any class which extends TransformationInterface is valid
Throws:
javax.servlet.jsp.JspException - Thrown if a JspException occurs.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
This Method Overrides the javax.servlet.jsp.tagext.TagSupport doStartTag Method. An instance of the wrapped class is loaded from the PageContext or created if it can not be found if the instantiate is true.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class BaseTag
Returns:
The doStart int return code.
Throws:
javax.servlet.jsp.JspException - Thrown if a JspException occurs.
See Also:
BaseTag.setInstantiate(boolean), TagSupport.doStartTag()

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
This Method Overrides the javax.servlet.jsp.tagext.TagSupport doEndTag Method.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
The doStart int return code.
Throws:
javax.servlet.jsp.JspException - Thrown if a JspException occurs.
See Also:
TagSupport.doEndTag(), BaseTag.setInstantiate(boolean)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.