jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.domutil
Class InvariantGenerator

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.InvariantGenerator
All Implemented Interfaces:
NodeGenerator, ResourceConsumer

public class InvariantGenerator
extends ElementGenerator

A generator which always (modulo i18n changes) generates the same thing, irrespective of the context

Version:
$Revision: 1.1.2.2 $
Author:
$author$

Field Summary
protected  java.lang.String cssClass
          the CSS class name I will use
protected  java.lang.String invariantContent
          the content which I will invariably generate
 
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
InvariantGenerator(java.lang.String tag, java.lang.String content)
          Constructor:
InvariantGenerator(java.lang.String tag, java.lang.String content, java.lang.String cssClass)
          Creates a new InvariantGenerator object.
 
Method Summary
 Node generate(Document doc, Context c)
          Generate an element
 
Methods inherited from class uk.co.weft.domutil.ElementGenerator
addGenerator, doinit, fetchDetail, generate, 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

invariantContent

protected java.lang.String invariantContent
the content which I will invariably generate


cssClass

protected java.lang.String cssClass
the CSS class name I will use

Constructor Detail

InvariantGenerator

public InvariantGenerator(java.lang.String tag,
                          java.lang.String content)
Constructor:

Parameters:
tag - the element name ('tag') to use
content - the content this element will always have

InvariantGenerator

public InvariantGenerator(java.lang.String tag,
                          java.lang.String content,
                          java.lang.String cssClass)
Creates a new InvariantGenerator object.

Parameters:
tag - the tag of the element I will generate
content - the content of the element I will generate
cssClass - the CSS class attribute of the leement I will generate
Method Detail

generate

public Node generate(Document doc,
                     Context c)
              throws GenerationException,
                     DOMException
Generate an element

Specified by:
generate in interface NodeGenerator
Overrides:
generate in class ElementGenerator
Parameters:
doc - the document within which the element is generated
c - the context in which the element is generated
Returns:
the generated element
Throws:
GenerationException - shouldn't happen
DOMException - if the underlying DOM implementeation throws and exception

jacquard 1.12.0 by The Web Engineering Factory and Toolworks