jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.domutil
Class DateGenerator

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.domutil.MaybeParseGenerator
              extended byuk.co.weft.domutil.ElementGenerator
                  extended byuk.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.
 
Fields inherited from class uk.co.weft.domutil.ElementGenerator
childrenAndContent, generators, keyname, mapping, storename, token
 
Fields inherited from class uk.co.weft.domutil.MaybeParseGenerator
embeddedMarkup
 
Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl
debug, name, namespaceURI
 
Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl
resourceBundleName
 
Fields inherited from interface uk.co.weft.domutil.NodeGenerator
NAMESPACEURIMAGICTOKEN
 
Fields inherited from interface uk.co.weft.htform.ResourceConsumer
RESOURCEBUNDLEMAGICTOKEN
 
Constructor Summary
DateGenerator()
           
DateGenerator(java.lang.String name)
           
DateGenerator(java.lang.String name, java.lang.String token)
           
 
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 uk.co.weft.domutil.ElementGenerator
addGenerator, doinit, fetchDetail, generate, getTokenValue, init, register, setChildrenAndContent
 
Methods inherited from class uk.co.weft.domutil.MaybeParseGenerator
allowEmbeddedMarkup, maybeParse
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getName, getNamespaceURI, setDebug, setNamespaceURI
 
Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.weft.domutil.NodeGenerator
getName, getNamespaceURI, setDebug
 

Field Detail

dayname

protected java.lang.String[] dayname
Names of days


monthname

protected java.lang.String[] monthname
Names of months.

Constructor Detail

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()
Method Detail

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 element
cal - the calendar to represent
tag - 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 element
tag - 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

jacquard 1.12.0 by The Web Engineering Factory and Toolworks