org.mmbase.util.transformers
Class CodeSampleFactory.CodeSample

java.lang.Object
  extended byorg.mmbase.util.transformers.StringTransformer
      extended byorg.mmbase.util.transformers.CodeSampleFactory.CodeSample
All Implemented Interfaces:
CharTransformer, Serializable, Transformer
Enclosing class:
CodeSampleFactory

protected class CodeSampleFactory.CodeSample
extends StringTransformer

See Also:
Serialized Form

Constructor Summary
CodeSampleFactory.CodeSample(String st, String ct, String ec, String er)
          Constructor
 
Method Summary
 String transform(String str)
          Default transform method with no (other) parameters then the string to transform while using <pre> as the tag between which to escape the text while using the default escaper 'text/html'.
 String transform(String str, String starttag, String closetag, String escapecode, String escaperest)
          Transforms the characters of a code example between two tags, <pre>-tags and </pre> f.e., within a string and can use a different escaper for the rest of the text.
 String transformPart(String str, String escaper)
          Transforms parts of the string.
 
Methods inherited from class org.mmbase.util.transformers.StringTransformer
transform, transform, transformBack, transformBack, transformBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.util.transformers.Transformer
toString
 

Constructor Detail

CodeSampleFactory.CodeSample

public CodeSampleFactory.CodeSample(String st,
                                    String ct,
                                    String ec,
                                    String er)
Constructor

Method Detail

transform

public String transform(String str)
Default transform method with no (other) parameters then the string to transform while using <pre> as the tag between which to escape the text while using the default escaper 'text/html'.

Specified by:
transform in interface CharTransformer
Specified by:
transform in class StringTransformer
Parameters:
str - The original string
Returns:
The transformed string

transform

public String transform(String str,
                        String starttag,
                        String closetag,
                        String escapecode,
                        String escaperest)
Transforms the characters of a code example between two tags, <pre>-tags and </pre> f.e., within a string and can use a different escaper for the rest of the text.

Parameters:
str - The original string
starttag - The opentag of the pair of tags between which code needs to be escaped
closetag - The closetag of the pair of tags between which code needs to be escaped
escapecode - The escaper to use on the piece of text between the tags
escaperest - The escaper to use on the rest of the text
Returns:
The transformed string

transformPart

public String transformPart(String str,
                            String escaper)
Transforms parts of the string. Calls the transform methods in XmlField and Xml. This method needs to be rewritten to support all escapers/transformers. It only supports p, pp, p-ommit-surrounding, pp-ommit-surrounding, inline, text/html and text/xml.

Parameters:
str - String to transform
escaper - The transformer or escaper to use (see escaper attr of <mm:content />)
Returns:
The transformed string


MMBase build 1.8.1.20060716