Class CodeSampleFactory

  extended byorg.mmbase.util.transformers.CodeSampleFactory
All Implemented Interfaces:

public class CodeSampleFactory
extends Object
implements ParameterizedTransformerFactory

This TransformerFactory enables the use of two different escapers in one piece of text. I started it to simplify the inclusion of a code snippet in html. You can specify the tags between which you wish to escape your text, the escaper to use and you can set an escaper for the rest of the text.
The tags default to <pre> and </pre>, the first escaper defaults to 'text/html' (which escapes &, <, >, " and leaves the linebreakes untouched). The last escaper does by default nothing. But of course you can set your own with the parameters 'starttag', 'closetag', 'escapecode' and 'escaperest'.

MMBase 1.8.0
$Id:,v 1.2 2006/04/14 11:25:29 andre Exp $
André van Toly

Nested Class Summary
protected  class CodeSampleFactory.CodeSample
Constructor Summary
Method Summary
 Parameters createParameters()
          Create empty Parameters object for use with createTransformer(Parameters).
 Transformer createTransformer(Parameters parameters)
          Creates a parameterized transformer.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CodeSampleFactory()
Method Detail


public Parameters createParameters()
Description copied from interface: ParameterizedTransformerFactory
Create empty Parameters object for use with ParameterizedTransformerFactory.createTransformer(Parameters).

Specified by:
createParameters in interface ParameterizedTransformerFactory


public Transformer createTransformer(Parameters parameters)
Description copied from interface: ParameterizedTransformerFactory
Creates a parameterized transformer.

Specified by:
createTransformer in interface ParameterizedTransformerFactory

MMBase build