org.apache.cocoon.taglib.datetime
Class MonthsTag

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.taglib.TagSupport
          extended by org.apache.cocoon.taglib.VarTagSupport
              extended by org.apache.cocoon.taglib.datetime.MonthsTag
All Implemented Interfaces:
Poolable, Recyclable, Component, LogEnabled, Serviceable, IterationTag, Tag

public class MonthsTag
extends VarTagSupport
implements IterationTag

Tag months, used to loop through all the months of the year.

The script variable of name var is availble only within the body of the months tag.

Version:
CVS $Id: MonthsTag.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Volker Schmitt

Field Summary
 
Fields inherited from class org.apache.cocoon.taglib.VarTagSupport
manager, var
 
Fields inherited from class org.apache.cocoon.taglib.TagSupport
objectModel, parameters, parent, resolver
 
Fields inherited from interface org.apache.cocoon.taglib.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface org.apache.cocoon.taglib.Tag
EVAL_BODY, EVAL_PAGE, ROLE, SKIP_BODY
 
Constructor Summary
MonthsTag()
           
 
Method Summary
 int doAfterBody()
          Method called at end of each months tag.
 int doEndTag(String namespaceURI, String localName, String qName)
          Process the end tag for this instance.
 int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
          Initializes tag so it can loop through the months of the year.
 String getMonth()
          Returns the long name of the month.
 String getMonthOfYear()
          Returns the number of the month.
 String getShortMonth()
          Returns the short name of the month.
 void recycle()
           
 
Methods inherited from class org.apache.cocoon.taglib.VarTagSupport
getRequest, getVar, getVariable, removeVariable, service, setVar, setVariable
 
Methods inherited from class org.apache.cocoon.taglib.TagSupport
findAncestorWithClass, findAttribute, getParent, setParent, setup
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.taglib.Tag
getParent, setParent, setup
 

Constructor Detail

MonthsTag

public MonthsTag()
Method Detail

doStartTag

public final int doStartTag(String namespaceURI,
                            String localName,
                            String qName,
                            Attributes atts)
                     throws SAXException
Initializes tag so it can loop through the months of the year.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
EVAL_BODY
Throws:
SAXException

doEndTag

public int doEndTag(String namespaceURI,
                    String localName,
                    String qName)
             throws SAXException
Description copied from class: TagSupport
Process the end tag for this instance.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class TagSupport
Returns:
EVAL_PAGE.
Throws:
SAXException

doAfterBody

public final int doAfterBody()
                      throws SAXException
Method called at end of each months tag.

Specified by:
doAfterBody in interface IterationTag
Returns:
EVAL_BODY_TAG if there is another month, or SKIP_BODY if there are no more months
Throws:
SAXException

getShortMonth

public final String getShortMonth()
Returns the short name of the month.

Returns:
String - short name of the month

getMonth

public final String getMonth()
Returns the long name of the month.

Returns:
String - long name of the month

getMonthOfYear

public final String getMonthOfYear()
Returns the number of the month.

Returns:
String - number of the month

recycle

public void recycle()
Specified by:
recycle in interface Recyclable
Overrides:
recycle in class VarTagSupport


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.