uk.co.weft.domutil
Class DateGenerator
java.lang.Object
uk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.domutil.MaybeParseGenerator
uk.co.weft.domutil.ElementGenerator
uk.co.weft.domutil.DateGenerator
- All Implemented Interfaces:
- NodeGenerator, ResourceConsumer
- public class DateGenerator
- extends ElementGenerator
an ElementGenerator which knows about dates and calendars. The object is to
generate an element which is sufficiently rich that an XSL stylesheet can
readily transform it into any alternate format which may be required.
- Version:
- $Revision: 1.5.4.5 $ This revision: $Author: simon $
- Author:
- Simon Brooke
|
Field Summary |
protected java.lang.String[] |
dayname
Names of days |
protected java.lang.String[] |
monthname
Names of months. |
|
Method Summary |
Node |
generate(Document doc,
java.util.Calendar cal,
java.lang.String tag)
Generate an element in this document with this tag representing this
calendar |
Node |
generate(Document doc,
Context c)
Specialisation: |
Node |
generate(Document doc,
java.lang.Object obj,
java.lang.String tag)
Construct an element representing this object with this name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dayname
protected java.lang.String[] dayname
- Names of days
monthname
protected java.lang.String[] monthname
- Names of months.
DateGenerator
public DateGenerator(java.lang.String name)
- Parameters:
name -
DateGenerator
public DateGenerator(java.lang.String name,
java.lang.String token)
- Parameters:
name - token -
DateGenerator
public DateGenerator()
generate
public Node generate(Document doc,
java.util.Calendar cal,
java.lang.String tag)
- Generate an element in this document with this tag representing this
calendar
- Parameters:
doc - the document in which to create the elementcal - the calendar to representtag - the tag for the element created
- Returns:
- the element
generate
public Node generate(Document doc,
Context c)
throws GenerationException,
DOMException
- Specialisation:
- Specified by:
generate in interface NodeGenerator- Overrides:
generate in class ElementGenerator
- Parameters:
doc - c -
- Returns:
-
- Throws:
GenerationException
DOMException- See Also:
ElementGenerator.generate(org.w3c.dom.Document,
uk.co.weft.dbutil.Context)
generate
public Node generate(Document doc,
java.lang.Object obj,
java.lang.String tag)
throws GenerationException,
DOMException
- Construct an element representing this object with this name.
Specialisation: if it's a Date or a Calendar I know what to do with it
- Overrides:
generate in class ElementGenerator
- Parameters:
doc - the document in which this element is to be created.obj - the object to represent in the generated elementtag - the name for this element
- Returns:
- the element created.
- Throws:
GenerationException - may throw a GenerationException if the
generation cannot be completed.
DOMException - will be passed through if Xerces barfs