org.apache.taglibs.dbtags.resultset
Class BaseGetterTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.taglibs.dbtags.resultset.BaseGetterTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
BaseDateTimeGetterTag, GetColumnTag, GetNumberTag

public class BaseGetterTag
extends javax.servlet.jsp.tagext.TagSupport

Base class for all the getter tags in the resultset package.

Author:
Morgan Delagrange, Marius Scurtescu
See Also:
Serialized Form

Field Summary
protected  java.lang.String _attributeName
           
protected  java.lang.String _locale
           
protected  java.sql.ResultSetMetaData _metaData
           
protected  java.lang.String _scope
           
protected  ResultSetTag _tag
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BaseGetterTag()
           
 
Method Summary
 int doEndTag()
          If I understand the new JSP spec correctly, release() is NOT called between invocations of a cached taglib, so I guess we do it manually or write a new method.
protected  java.util.Locale getLocale(java.lang.String strLocale)
          Create a Locale for the formatting of dates, times, and numbers.
protected  java.sql.ResultSetMetaData getMetaData()
          Get the MetaData object for this result set
 int getPosition()
          Gets the column number for the result set.
protected  java.sql.ResultSet getResultSet()
          Get the ResultSet object from the enclosing resultset tag
protected  ResultSetTag getResultSetTag()
          Get the parent result set tag
 void release()
           
protected  void setAttribute(java.lang.String name, java.lang.Object object, java.lang.String scope)
          Set an attribute to the specified scope.
 void setColName(java.lang.String strName)
          Sets the column name if the result set.
 void setLocale(java.lang.String strLocale)
           
 void setPosition(int position)
          Sets the column number of the result set.
 void setPosition(java.lang.String strPosition)
          Sets the column number of the result set.
 void setScope(java.lang.String scope)
          Scope of the attribute.
 void setTo(java.lang.String attributeName)
          Name of the attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_attributeName

protected java.lang.String _attributeName

_scope

protected java.lang.String _scope

_tag

protected ResultSetTag _tag

_metaData

protected java.sql.ResultSetMetaData _metaData

_locale

protected java.lang.String _locale
Constructor Detail

BaseGetterTag

public BaseGetterTag()
Method Detail

setLocale

public void setLocale(java.lang.String strLocale)

setPosition

public void setPosition(int position)
Sets the column number of the result set.

Parameters:
position - column index

getPosition

public int getPosition()
                throws javax.servlet.jsp.JspTagException
Gets the column number for the result set.

Returns:
column position (1,2,3,etc.)
Throws:
javax.servlet.jsp.JspTagException

setPosition

public void setPosition(java.lang.String strPosition)
                 throws javax.servlet.jsp.JspTagException
Sets the column number of the result set.

Parameters:
position - column index
Throws:
javax.servlet.jsp.JspTagException

setColName

public void setColName(java.lang.String strName)
Sets the column name if the result set.

Parameters:
strName - The column name.

setTo

public void setTo(java.lang.String attributeName)
Name of the attribute.

Parameters:
attributeName - attribute name

setScope

public void setScope(java.lang.String scope)
Scope of the attribute.

Parameters:
scope - scope (page | request | session | application)

setAttribute

protected void setAttribute(java.lang.String name,
                            java.lang.Object object,
                            java.lang.String scope)
Set an attribute to the specified scope.

Parameters:
name - name of the attribute
object - the attribute
scope - attribute scope (page | request | session | application)

getResultSet

protected java.sql.ResultSet getResultSet()
                                   throws javax.servlet.jsp.JspTagException
Get the ResultSet object from the enclosing resultset tag

Returns:
ResultSet of the resultset tag
Throws:
javax.servlet.jsp.JspTagException

getMetaData

protected java.sql.ResultSetMetaData getMetaData()
                                          throws javax.servlet.jsp.JspTagException
Get the MetaData object for this result set

Returns:
Meta data object
Throws:
javax.servlet.jsp.JspTagException

getResultSetTag

protected ResultSetTag getResultSetTag()
                                throws javax.servlet.jsp.JspTagException
Get the parent result set tag

Returns:
ResultSetTag
Throws:
javax.servlet.jsp.JspTagException

getLocale

protected java.util.Locale getLocale(java.lang.String strLocale)
Create a Locale for the formatting of dates, times, and numbers.

Parameters:
strLocale -
Returns:
the indicated Locale

doEndTag

public int doEndTag()
If I understand the new JSP spec correctly, release() is NOT called between invocations of a cached taglib, so I guess we do it manually or write a new method.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
EVAL_PAGE constant

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.