com.windgazer.util.io.taglib
Class FileAttributeTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.windgazer.util.io.taglib.FileAttributeTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
FileContentTag, FileLengthTag, FileNameTag, FileRelativePathTag

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

FileAttributeTag is the base for creating short-coded attibute-tags.
Attribute tags in this context are tags that print a short string representing one of the providers attributes.
This Tag will try and find the surrounding FileProvider and pass it on to the getTagPrintString(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
FileAttributeTag()
           
 
Method Summary
 int doStartTag()
          Gets the File from the surrounding FileProvider and prints the result of getTagPrintString(File) to the pageContext.
abstract  java.lang.String getTagPrintString(java.io.File myFile)
          Return the value of an attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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

FileAttributeTag

public FileAttributeTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Gets the File from the surrounding FileProvider and prints the result of getTagPrintString(File) to the pageContext.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY
javax.servlet.jsp.JspTagException
See Also:
getTagPrintString(File)

getTagPrintString

public abstract java.lang.String getTagPrintString(java.io.File myFile)
                                            throws java.io.IOException
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 String containing the value of an attribute.
java.io.IOException
See Also:
doStartTag()


Copyright © 2003 Windgazer Design. All Rights Reserved.