org.radeox.macro
Class Preserved

java.lang.Object
  extended byorg.radeox.macro.BaseMacro
      extended byorg.radeox.macro.Preserved
All Implemented Interfaces:
java.lang.Comparable, Macro
Direct Known Subclasses:
LocalePreserved

public abstract class Preserved
extends BaseMacro

A specialized macro that allows to preserve certain special characters by creating character entities. The subclassing macro may decide whether to call replace() before or after executing the actual macro substitution.

Version:
$Id: Preserved.java,v 1.6 2003/12/17 12:43:08 leo Exp $
Author:
Matthias L. Jugel

Field Summary
 
Fields inherited from class org.radeox.macro.BaseMacro
description, initialContext, paramDescription
 
Constructor Summary
Preserved()
           
 
Method Summary
protected  void addSpecial(char c)
          Encode special character c by replacing with it's hex character entity code.
protected  void addSpecial(java.lang.String c, java.lang.String replacement)
          Add a replacement for the special character c which may be a string
protected  java.lang.String replace(java.lang.String source)
          Actually replace specials in source.
 
Methods inherited from class org.radeox.macro.BaseMacro
compareTo, execute, getDescription, getName, getParamDescription, setInitialContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Preserved

public Preserved()
Method Detail

addSpecial

protected void addSpecial(char c)
Encode special character c by replacing with it's hex character entity code.


addSpecial

protected void addSpecial(java.lang.String c,
                          java.lang.String replacement)
Add a replacement for the special character c which may be a string

Parameters:
c - the character to replace
replacement - the new string

replace

protected java.lang.String replace(java.lang.String source)
Actually replace specials in source. This method can be used by subclassing macros.

Parameters:
source - String to encode
Returns:
encoded Encoded string


Copyright © 2003 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved.