com.windgazer.util.io.taglib
Class FileBooleanAttributeTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.windgazer.util.io.taglib.FileBooleanAttributeTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
DirectoryHasIndexTag, FileCanReadTag, FileCanWriteTag, FileExistsTag, FileIsDirectoryTag, FileIsHiddenTag, FileIsTypeTag

public abstract class FileBooleanAttributeTag
extends javax.servlet.jsp.tagext.TagSupport

FileBooleanAttributeTag is the base for creating short-coded boolean-tags.
BooleanAttribute tags in this context are tags that determine wether or not to evaluate their body acording to one of the providers attributes.
This Tag will try and find the surrounding FileProvider and pass it on to the getTagBoolean(File) method so that the short-coded implementation of this tag needs only to read and return the desired attribute.

Version:
1.1
Author:
Martin 'Kemanorel' Reurings
See Also:
Serialized Form

Field Summary
 
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
FileBooleanAttributeTag()
           
 
Method Summary
 int doEndTag()
          Implementation of the BodyTagSupport Class.
 int doStartTag()
          Gets the File from the surrounding FileProvider and returns either SKIP_BODY or EVAL_BODY_INCLUDE based upon the return value of getTagBoolean(File).
abstract  boolean getTagBoolean(java.io.File myFile)
          Return the value of an attribute.
 void setReverse(boolean bReverseIn)
          Reverse the logic of doStartTag().
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBooleanAttributeTag

public FileBooleanAttributeTag()
Method Detail

setReverse

public void setReverse(boolean bReverseIn)
Reverse the logic of doStartTag(). This property enables the tag to evaluate it's body when the attribute returns false instead. Usefull for instance when you want to print one value when the attribute is set and another when it's not set.

Parameters:
bReverseIn - true if you want reversed logic, default set to false.

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Gets the File from the surrounding FileProvider and returns either SKIP_BODY or EVAL_BODY_INCLUDE based upon the return value of getTagBoolean(File).

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY or EVAL_BODY_INCLUDE, based upon the return value of getTagBoolean(File).
javax.servlet.jsp.JspTagException
See Also:
getTagBoolean(File)

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Implementation of the BodyTagSupport Class. Resets some of the information, stored in this tag, to their default values.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
super.doEndTag()
javax.servlet.jsp.JspException

getTagBoolean

public abstract boolean getTagBoolean(java.io.File myFile)
Return the value of an attribute.
This method is called by doStartTag and must be implemented to return a value for an attribute of File.

Parameters:
myFile - The File returned by the surrounding FileProvider.
Returns:
A Boolean containing the value of an attribute.
See Also:
doStartTag()


Copyright © 2003 Windgazer Design. All Rights Reserved.