org.x4juli.global.helper
Class Transform

java.lang.Object
  extended byorg.x4juli.global.helper.Transform

public final class Transform
extends java.lang.Object

Utility class for transforming strings.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Ceki Gülcü Michael A. McAngus. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
private static java.lang.String CDATA_EMBEDED_END
           
private static java.lang.String CDATA_END
           
private static int CDATA_END_LEN
           
private static java.lang.String CDATA_PSEUDO_END
           
private static java.lang.String CDATA_START
           
 
Constructor Summary
private Transform()
          No instanciation wanted.
 
Method Summary
static void appendEscapingCDATA(java.io.Writer output, java.lang.String str)
          Ensures that embeded CDEnd strings (]]>) are handled properly within message, NDC and throwable tag text.
static void escapeTags(java.lang.String input, java.io.Writer output)
          This method takes a string which may contain HTML tags (ie, <b>, <table>, etc) and replaces any '<' and '>' characters with respective predefined entity references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDATA_START

private static final java.lang.String CDATA_START
See Also:
Constant Field Values

CDATA_END

private static final java.lang.String CDATA_END
See Also:
Constant Field Values

CDATA_PSEUDO_END

private static final java.lang.String CDATA_PSEUDO_END
See Also:
Constant Field Values

CDATA_EMBEDED_END

private static final java.lang.String CDATA_EMBEDED_END
See Also:
Constant Field Values

CDATA_END_LEN

private static final int CDATA_END_LEN
Constructor Detail

Transform

private Transform()
No instanciation wanted.

Method Detail

escapeTags

public static void escapeTags(java.lang.String input,
                              java.io.Writer output)
                       throws java.io.IOException
This method takes a string which may contain HTML tags (ie, <b>, <table>, etc) and replaces any '<' and '>' characters with respective predefined entity references.

Parameters:
input - The text to be converted.
output - The input string with the characters '<' and '>' replaced with &lt; and &gt; respectively.
Throws:
java.io.IOException
Since:
0.5

appendEscapingCDATA

public static void appendEscapingCDATA(java.io.Writer output,
                                       java.lang.String str)
                                throws java.io.IOException
Ensures that embeded CDEnd strings (]]>) are handled properly within message, NDC and throwable tag text.

Parameters:
output - Writer. The initial CDSutart () of the CDATA section are the responsibility of the calling method.
str - The String that is inserted into an existing CDATA Section.
Throws:
java.io.IOException
Since:
0.5


${license_html}