org.apache.cocoon.taglib.datetime
Class MonthsTag
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.taglib.TagSupport
org.apache.cocoon.taglib.VarTagSupport
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MonthsTag
public MonthsTag()
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.