org.mmbase.util.transformers
Class CodeSampleFactory

java.lang.Object
  extended byorg.mmbase.util.transformers.CodeSampleFactory
All Implemented Interfaces:
ParameterizedTransformerFactory

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'.

Since:
MMBase 1.8.0
Version:
$Id: CodeSampleFactory.java,v 1.2 2006/04/14 11:25:29 andre Exp $
Author:
André van Toly

Nested Class Summary
protected  class CodeSampleFactory.CodeSample
           
 
Constructor Summary
CodeSampleFactory()
           
 
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

CodeSampleFactory

public CodeSampleFactory()
Method Detail

createParameters

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

Specified by:
createParameters in interface ParameterizedTransformerFactory

createTransformer

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

Specified by:
createTransformer in interface ParameterizedTransformerFactory


MMBase build 1.8.1.20060716