jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.domutil
Class CommentGenerator

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.domutil.CommentGenerator
All Implemented Interfaces:
NodeGenerator, ResourceConsumer

public class CommentGenerator
extends NodeGeneratorImpl

A generator which generates a comment, using as content either the value of my token in the generate-time context, or, if there is none, then just my token.


Field Summary
protected  java.lang.String token
          The token whose value in the generate time context will be the content of the section I generate.
 
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
CommentGenerator(java.lang.String token)
          Creates a new CDataSectionGenerator object.
 
Method Summary
 Node generate(Document doc, Context c)
          generates a comment, using as content either the value of my token in the generate-time context, or, if there is none, then just my token.
 java.lang.String getName()
          get my name
 void init(Context config)
          required by NodeGenerator interface but in practice not needed here.
 void setDebug(boolean debug)
          required by NodeGenerator interface but in practice not needed here.
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getNamespaceURI, 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
 

Field Detail

token

protected java.lang.String token
The token whose value in the generate time context will be the content of the section I generate.

Constructor Detail

CommentGenerator

public CommentGenerator(java.lang.String token)
Creates a new CDataSectionGenerator object.

Parameters:
token - a token whose value in the generate time context will be the content of the section I generate.
Method Detail

setDebug

public void setDebug(boolean debug)
required by NodeGenerator interface but in practice not needed here.

Specified by:
setDebug in interface NodeGenerator
Overrides:
setDebug in class NodeGeneratorImpl
Parameters:
debug - whether or not to set debugging mode

getName

public java.lang.String getName()
Description copied from class: NodeGeneratorImpl
get my name

Specified by:
getName in interface NodeGenerator
Overrides:
getName in class NodeGeneratorImpl
Returns:
the token I use to collect my content from the context

generate

public Node generate(Document doc,
                     Context c)
              throws GenerationException,
                     DOMException
generates a comment, using as content either the value of my token in the generate-time context, or, if there is none, then just my token.

Specified by:
generate in interface NodeGenerator
Specified by:
generate in class NodeGeneratorImpl
Parameters:
doc - the document in which this element is to be created.
c - the context in which this generation takes place
Returns:
the element created.
Throws:
GenerationException - may throw a GenerationException if the generation cannot be completed.
DOMException

init

public void init(Context config)
          throws InitialisationException
required by NodeGenerator interface but in practice not needed here.

Specified by:
init in interface NodeGenerator
Specified by:
init in class NodeGeneratorImpl
Parameters:
config - a context containing configuration information.
Throws:
InitialisationException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks