org.mmbase.util.transformers
Class CodeSampleFactory.CodeSample
java.lang.Object
org.mmbase.util.transformers.StringTransformer
org.mmbase.util.transformers.CodeSampleFactory.CodeSample
- All Implemented Interfaces:
- CharTransformer, Serializable, Transformer
- Enclosing class:
- CodeSampleFactory
- protected class CodeSampleFactory.CodeSample
- extends StringTransformer
- See Also:
- Serialized Form
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CodeSampleFactory.CodeSample
public CodeSampleFactory.CodeSample(String st,
String ct,
String ec,
String er)
- Constructor
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 stringstarttag - The opentag of the pair of tags between which code needs to be escapedclosetag - The closetag of the pair of tags between which code needs to be escapedescapecode - The escaper to use on the piece of text between the tagsescaperest - 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 transformescaper - The transformer or escaper to use (see escaper attr of <mm:content />)
- Returns:
- The transformed string
MMBase build 1.8.1.20060716