org.apache.taglibs.dbtags.preparedstatement
Class BaseSetterTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byorg.apache.taglibs.dbtags.preparedstatement.BaseSetterTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

Base class for all the setter tags without bodies in the preparedstatement package.

Author:
Morgan Delagrange
See Also:
Serialized Form

Field Summary
protected  java.lang.String _attributeName
           
protected  int _position
           
 
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
BaseSetterTag()
           
 
Method Summary
protected  java.lang.Object getAttribute(java.lang.String name)
          Gets the page attribute for the tag
protected  java.sql.PreparedStatement getPreparedStatement()
          get the PreparedStatement from the enclosing tag
protected  int getSqlTypeForFieldName(java.lang.String fieldName)
          Perfoms reflection to translate a String name to one of the int values of java.sql.Types
 void release()
           
 void setName(java.lang.String attributeName)
          Name of the page attribute that will be assigned to the statement.
 void setPosition(int position)
          Sets the column number of the prepared statement.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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

_position

protected int _position

_attributeName

protected java.lang.String _attributeName
Constructor Detail

BaseSetterTag

public BaseSetterTag()
Method Detail

setPosition

public void setPosition(int position)
Sets the column number of the prepared statement.

Parameters:
position - column index

setName

public void setName(java.lang.String attributeName)
Name of the page attribute that will be assigned to the statement.

Parameters:
attributeName - attribute name

getAttribute

protected java.lang.Object getAttribute(java.lang.String name)
                                 throws javax.servlet.jsp.JspTagException
Gets the page attribute for the tag

Parameters:
name - name of the attribute
Returns:
the page attribute
Throws:
javax.servlet.jsp.JspTagException - thrown when the page attribute does not exist

getPreparedStatement

protected java.sql.PreparedStatement getPreparedStatement()
                                                   throws javax.servlet.jsp.JspTagException
get the PreparedStatement from the enclosing tag

Returns:
the PreparedStatement
Throws:
javax.servlet.jsp.JspTagException - thrown if no PreparedStatement exists

getSqlTypeForFieldName

protected int getSqlTypeForFieldName(java.lang.String fieldName)
                              throws javax.servlet.jsp.JspTagException
Perfoms reflection to translate a String name to one of the int values of java.sql.Types

Parameters:
fieldName - name of the field in java.sql.Types
Returns:
int value of the sql type
Throws:
javax.servlet.jsp.JspTagException - thrown if the sql type does not exist, or if reflection fails

release

public void release()


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