xdoclet.modules.apache.struts
Class StrutsValidatorTagsHandler

java.lang.Object
  extended by xdoclet.template.TemplateTagHandler
      extended by xdoclet.XDocletTagSupport
          extended by xdoclet.tagshandler.AbstractProgramElementTagsHandler
              extended by xdoclet.modules.apache.struts.StrutsValidatorTagsHandler
Direct Known Subclasses:
StrutsDynaFormValidatorTagsHandler

public class StrutsValidatorTagsHandler
extends AbstractProgramElementTagsHandler

Struts Validator tag handler tags

Version:
$Revision: 1.12 $
Author:
Erik Hatcher (ehatcher@apache.org)
xdoclet.taghandler
namespace = "Validator"
created
August 23, 2002

Field Summary
protected  java.util.Map args
           
protected  java.lang.String curFieldName
           
protected  java.lang.String currentArgKey
           
protected static java.util.List supportedTypes
           
 
Fields inherited from class xdoclet.tagshandler.AbstractProgramElementTagsHandler
currentToken, matchPattern, tagTokenizer
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
StrutsValidatorTagsHandler()
           
 
Method Summary
 java.lang.String argIndex(java.util.Properties props)
          Current argument index number (0 to 3).
 java.lang.String argName(java.util.Properties props)
          Current argument name - only valid if argument is for a specific validator type.
 java.lang.String argValue(java.util.Properties props)
          Current argument value, which is either an inline value or resource key.
 java.lang.String fieldName(java.util.Properties props)
          Returns the current field's name, local to the indexed property if there is one.
 void forAllFieldArgs(java.lang.String template, java.util.Properties attributes)
          Iterates over all arguments for the current field.
 void forAllFields(java.lang.String template, java.util.Properties attributes)
          Iterates the body for each field of the current form requiring validation.
 void forAllForms(java.lang.String template, java.util.Properties attributes)
          Iterates over all Struts Form beans and evaluates the body of the tag for each class.
 java.lang.String formName(java.util.Properties attributes)
          Gets the "name" attribute for the <form> element in the xml descriptor.
protected  java.util.Map getFields(xjavadoc.XClass clazz)
           
protected  java.util.Map getFields(xjavadoc.XClass clazz, java.lang.String prefix)
           
 void ifArgIsForType(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if the current argument is a validator-specific argument.
 void ifArgIsResource(java.lang.String template, java.util.Properties attributes)
          Evaluates body if current argument is a resource key.
 void ifArgIsValue(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if the current argument is an inline value rather than a resource key.
 void ifFieldIsIndexed(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if the current field has an indexed component.
 void ifFormHasFields(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if form has fields requiring validation.
 void ifNoArg0(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if there is no arg0 specified.
 java.lang.String indexedListProperty(java.util.Properties props)
          Returns the current field's indexedListProperty attribute, if any.
protected  void loadFieldArguments()
           
 java.lang.String validatorList(java.util.Properties props)
          Returns a comma-separated list of the specified validator types.
 
Methods inherited from class xdoclet.tagshandler.AbstractProgramElementTagsHandler
checkForWrap, currentToken, exceptionList, firstSentenceDescriptionOfCurrentMember, forAllMembers, forAllMemberTags, forAllMemberTagTokens, getAllClasses, getClassNameFor, getFullClassNameFor, getFullSuperclassNameFor, getIndentChars, getXExecutableMemberForMemberName, getXExecutableMemberForMemberName, hasExecutableMember_OLD, hasExecutableMember, makeCopyOfArray, matchValue, memberComment, setMatchValue, skipToken
 
Methods inherited from class xdoclet.XDocletTagSupport
delimit, expandClassName, generate, getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getDocletContext, getEngine, getExpandedDelimitedTagValue, getTagValue, getTagValue, getTagValue, hasHavingClassTag, hasTag, isTagValueEqual, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, modifiers, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage
 
Methods inherited from class xdoclet.template.TemplateTagHandler
getXJavaDoc, setXJavaDoc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedTypes

protected static final java.util.List supportedTypes

curFieldName

protected java.lang.String curFieldName

currentArgKey

protected java.lang.String currentArgKey

args

protected java.util.Map args
Constructor Detail

StrutsValidatorTagsHandler

public StrutsValidatorTagsHandler()
Method Detail

forAllForms

public void forAllForms(java.lang.String template,
                        java.util.Properties attributes)
                 throws XDocletException
Iterates over all Struts Form beans and evaluates the body of the tag for each class.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

formName

public java.lang.String formName(java.util.Properties attributes)
                          throws XDocletException
Gets the "name" attribute for the <form> element in the xml descriptor. This should be the "path" form attribute if this is a ValidatorActiorForm or the "name" attribute otherwise.

Parameters:
attributes - The content tag attributes.
Returns:
form name
Throws:
XDocletException - if anything goes awry.
doc.tag
type = "content"

forAllFieldArgs

public void forAllFieldArgs(java.lang.String template,
                            java.util.Properties attributes)
                     throws XDocletException
Iterates over all arguments for the current field.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

argIndex

public java.lang.String argIndex(java.util.Properties props)
Current argument index number (0 to 3).

Parameters:
props - The content tag attributes.
Returns:
current argument index
doc.tag
type = "content"

argName

public java.lang.String argName(java.util.Properties props)
Current argument name - only valid if argument is for a specific validator type.

Parameters:
props - The content tag attributes.
Returns:
current argument name
doc.tag
type = "content"

argValue

public java.lang.String argValue(java.util.Properties props)
Current argument value, which is either an inline value or resource key.

Parameters:
props - The content tag attributes.
Returns:
current argument value
doc.tag
type = "content"

ifArgIsResource

public void ifArgIsResource(java.lang.String template,
                            java.util.Properties attributes)
                     throws XDocletException
Evaluates body if current argument is a resource key.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

ifArgIsValue

public void ifArgIsValue(java.lang.String template,
                         java.util.Properties attributes)
                  throws XDocletException
Evaluates the body if the current argument is an inline value rather than a resource key.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

ifArgIsForType

public void ifArgIsForType(java.lang.String template,
                           java.util.Properties attributes)
                    throws XDocletException
Evaluates the body if the current argument is a validator-specific argument.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

ifNoArg0

public void ifNoArg0(java.lang.String template,
                     java.util.Properties attributes)
              throws XDocletException
Evaluates the body if there is no arg0 specified.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

ifFormHasFields

public void ifFormHasFields(java.lang.String template,
                            java.util.Properties attributes)
                     throws XDocletException
Evaluates the body if form has fields requiring validation.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

ifFieldIsIndexed

public void ifFieldIsIndexed(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
Evaluates the body if the current field has an indexed component.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

forAllFields

public void forAllFields(java.lang.String template,
                         java.util.Properties attributes)
                  throws XDocletException
Iterates the body for each field of the current form requiring validation.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException
doc.tag
type = "block"

fieldName

public java.lang.String fieldName(java.util.Properties props)
Returns the current field's name, local to the indexed property if there is one.

Parameters:
props - The content tag attributes.
Returns:
current field name
doc.tag
type = "content"

indexedListProperty

public java.lang.String indexedListProperty(java.util.Properties props)
Returns the current field's indexedListProperty attribute, if any.

Parameters:
props - The content tag attributes.
Returns:
current field's indexedListProperty
doc.tag
type = "content"

validatorList

public java.lang.String validatorList(java.util.Properties props)
Returns a comma-separated list of the specified validator types.

Parameters:
props - The content tag attributes.
Returns:
validator types list
doc.tag
type = "content"

getFields

protected java.util.Map getFields(xjavadoc.XClass clazz)
                           throws XDocletException
Throws:
XDocletException

getFields

protected java.util.Map getFields(xjavadoc.XClass clazz,
                                  java.lang.String prefix)
                           throws XDocletException
Throws:
XDocletException

loadFieldArguments

protected void loadFieldArguments()

http://xdoclet.sourceforge.net/