uk.co.weft.domutil
Class InvariantGenerator
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.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 |
|
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
InvariantGenerator
public InvariantGenerator(java.lang.String tag,
java.lang.String content)
- Constructor:
- Parameters:
tag - the element name ('tag') to usecontent - 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 generatecontent - the content of the element I will generatecssClass - the CSS class attribute of the leement I will generate
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 generatedc - 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