uk.co.weft.domutil
Class InvariantTextGenerator
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.InvariantTextGenerator
- All Implemented Interfaces:
- NodeGenerator, ResourceConsumer
- public class InvariantTextGenerator
- extends ElementGenerator
A generator which always (modulo i18n changes) generates the same text,
irrespective of the context
- Version:
- $Revision: 1.2.4.1 $
- 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 |
| 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
InvariantTextGenerator
public InvariantTextGenerator(java.lang.String content)
- Creates a new InvariantGenerator object.
- Parameters:
content - the content of the element I will generate
generate
public Node generate(Document doc,
Context c)
throws GenerationException,
DOMException
- Generate a text 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