net.sourceforge.stripes.tag
Class FieldMetadataTag

java.lang.Object
  extended by net.sourceforge.stripes.tag.StripesTagSupport
      extended by net.sourceforge.stripes.tag.HtmlTagSupport
          extended by net.sourceforge.stripes.tag.FieldMetadataTag
All Implemented Interfaces:
BodyTag, DynamicAttributes, IterationTag, JspTag, Tag

public class FieldMetadataTag
extends HtmlTagSupport
implements BodyTag

Field metadata tag for use with the Stripes framework. Exposes field properties via JavaScript to allow client side validation. If this tag has a body it will be wrapped with JavaScript tags for convenience.

Author:
Aaron Porter

Nested Class Summary
 class FieldMetadataTag.Var
          This is what is placed into the request attribute.
 
Field Summary
 
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport
pageContext, parentTag
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
FieldMetadataTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
          Abstract method from the Tag interface.
 void doInitBody()
           
 int doStartTag()
          Abstract method from the Tag interface.
 String getAction()
           
 Object getBeanclass()
          Corresponding getter for 'beanclass', will always return null.
 String getFields()
           
 FormTag getForm()
           
 String getVar()
           
 boolean isFqn()
           
 boolean isIncludeType()
           
 void setAction(String action)
          Sets the action for the form.
 void setBeanclass(Object beanclass)
          Sets the 'action' attribute by inspecting the bean class provided and asking the current ActionResolver what the appropriate URL is.
 void setFields(String fields)
          Optional comma separated list of additional fields to expose.
 void setFqn(boolean fqn)
          Set to true to include the fully qualified class name for all fields.
 void setIncludeType(boolean includeType)
          Set to true to include type information for all fields.
 void setVar(String var)
          Sets the name of the variable to hold metadata.
 
Methods inherited from class net.sourceforge.stripes.tag.HtmlTagSupport
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag
 
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.BodyTag
setBodyContent
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, release, setPageContext, setParent
 

Constructor Detail

FieldMetadataTag

public FieldMetadataTag()
Method Detail

getForm

public FormTag getForm()

doInitBody

public void doInitBody()
                throws JspException
Specified by:
doInitBody in interface BodyTag
Throws:
JspException

doAfterBody

public int doAfterBody()
                throws JspException
Specified by:
doAfterBody in interface IterationTag
Throws:
JspException

doStartTag

public int doStartTag()
               throws JspException
Description copied from class: StripesTagSupport
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

Specified by:
doStartTag in interface Tag
Specified by:
doStartTag in class StripesTagSupport
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Description copied from class: StripesTagSupport
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

Specified by:
doEndTag in interface Tag
Specified by:
doEndTag in class StripesTagSupport
Throws:
JspException

getVar

public String getVar()

setVar

public void setVar(String var)
Sets the name of the variable to hold metadata.

Parameters:
var - the name of the attribute that will contain field metadata

getFields

public String getFields()

setFields

public void setFields(String fields)
Optional comma separated list of additional fields to expose. Any fields that have already been added to the Stripes form tag will automatically be included.

Parameters:
fields - comma separated list of field names

isIncludeType

public boolean isIncludeType()

setIncludeType

public void setIncludeType(boolean includeType)
Set to true to include type information for all fields. By default, type information is only included for primitives, numbers, and dates.

Parameters:
includeType - include type info for all fields

isFqn

public boolean isFqn()

setFqn

public void setFqn(boolean fqn)
Set to true to include the fully qualified class name for all fields.

Parameters:
fqn - include fully qualified class name for all fields

setAction

public void setAction(String action)
Sets the action for the form. If the form action begins with a slash, and does not already contain the context path, then the context path of the web application will get prepended to the action before it is set. In general actions should be specified as "absolute" paths within the web application, therefore allowing them to function correctly regardless of the address currently shown in the browser's address bar.

Parameters:
action - the action path, relative to the root of the web application

getAction

public String getAction()

setBeanclass

public void setBeanclass(Object beanclass)
                  throws StripesJspException
Sets the 'action' attribute by inspecting the bean class provided and asking the current ActionResolver what the appropriate URL is.

Parameters:
beanclass - the String FQN of the class, or a Class representing the class
Throws:
StripesJspException - if the URL cannot be determined for any reason, most likely because of a mis-spelled class name, or a class that's not an ActionBean

getBeanclass

public Object getBeanclass()
Corresponding getter for 'beanclass', will always return null.



? Copyright 2005-2006, Stripes Development Team.