|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.generation.AbstractGenerator org.apache.cocoon.generation.ServiceableGenerator org.apache.cocoon.generation.CalendarGenerator
public class CalendarGenerator
Field Summary | |
---|---|
protected AttributesImpl |
attributes
Convenience object, so we don't need to create an AttributesImpl for every element. |
protected List |
cacheKeyParList
The cache key needs to be generated for the configuration of this generator, so storing the parameters for generateKey(). |
protected static String |
CALENDAR_NODE_NAME
Node and attribute names |
protected static String |
DATE_ATTR_NAME
|
protected DateFormat |
dateFormatter
The format for dates |
protected static String |
DAY_NODE_NAME
|
protected Locale |
locale
The current locale |
protected int |
month
The month to generate the calendar for |
protected static String |
MONTH_ATTR_NAME
|
protected DateFormat |
monthFormatter
The format for month names |
protected static DecimalFormat |
monthNumberFormatter
Formatter for month number |
protected static String |
NEXT_MONTH_ATTR_NAME
|
protected static String |
NEXT_YEAR_ATTR_NAME
|
protected static String |
NUMBER_ATTR_NAME
|
protected boolean |
padWeeks
Do we need to pad out the first and last weeks? |
protected static String |
PREFIX
The namespace prefix for this namespace. |
protected static String |
PREV_MONTH_ATTR_NAME
|
protected static String |
PREV_YEAR_ATTR_NAME
|
protected static String |
URI
The URI of the namespace of this generator. |
protected static String |
WEEK_NODE_NAME
|
protected static String |
WEEKDAY_ATTR_NAME
|
protected String[] |
weekdays
|
protected int |
year
The year to generate the calendar for |
protected static String |
YEAR_ATTR_NAME
|
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator |
---|
manager |
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator |
---|
objectModel, parameters, resolver, source |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.generation.Generator |
---|
ROLE |
Constructor Summary | |
---|---|
CalendarGenerator()
|
Method Summary | |
---|---|
protected void |
addContent(Calendar date,
Locale locale)
Add content to a <day> element. |
void |
generate()
Generate XML data. |
Serializable |
getKey()
Generate the unique key. |
SourceValidity |
getValidity()
Generate the validity object. |
void |
recycle()
Recycle resources |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Set the request parameters. |
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator |
---|
dispose, service |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
setConsumer, setContentHandler, setLexicalHandler |
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.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
protected static final String URI
protected static final String PREFIX
protected static final String CALENDAR_NODE_NAME
protected static final String WEEK_NODE_NAME
protected static final String DAY_NODE_NAME
protected static final String MONTH_ATTR_NAME
protected static final String YEAR_ATTR_NAME
protected static final String DATE_ATTR_NAME
protected static final String NUMBER_ATTR_NAME
protected static final String WEEKDAY_ATTR_NAME
protected static final String PREV_MONTH_ATTR_NAME
protected static final String PREV_YEAR_ATTR_NAME
protected static final String NEXT_MONTH_ATTR_NAME
protected static final String NEXT_YEAR_ATTR_NAME
protected static final DecimalFormat monthNumberFormatter
protected AttributesImpl attributes
protected List cacheKeyParList
protected int year
protected int month
protected DateFormat dateFormatter
protected DateFormat monthFormatter
protected Locale locale
protected boolean padWeeks
protected String[] weekdays
Constructor Detail |
---|
public CalendarGenerator()
Method Detail |
---|
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
setup
in interface SitemapModelComponent
setup
in class AbstractGenerator
resolver
- the SourceResolver objectobjectModel
- a Map
containing model objectsrc
- the source URI (ignored)par
- configuration parameters
ProcessingException
SAXException
IOException
public void generate() throws SAXException, ProcessingException
generate
in interface Generator
SAXException
- if an error occurs while outputting the document
ProcessingException
protected void addContent(Calendar date, Locale locale) throws SAXException
date
- The date corresponding to the current element.locale
- The current locale.
SAXException
- if an error occurs while outputting the documentpublic Serializable getKey()
CacheableProcessingComponent
getKey
in interface CacheableProcessingComponent
null
if the component
is currently not cacheable.public SourceValidity getValidity()
CacheableProcessingComponent
getValidity
in interface CacheableProcessingComponent
null
if the
component is currently not cacheable.public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractGenerator
Recyclable.recycle()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |