Class Format.DefaultEscapeStrategy

java.lang.Object
  extended by Format.DefaultEscapeStrategy
All Implemented Interfaces:
EscapeStrategy
Enclosing class:
Format
 class Format.DefaultEscapeStrategy
extends java.lang.Object
implements EscapeStrategy

Handle common charsets quickly and easily. Use reflection to query the JDK 1.4 CharsetEncoder class for unknown charsets. If JDK 1.4 isn't around, default to no special encoding.

Field Summary
private  intbits
           
(package private)  java.lang.reflect.MethodcanEncode
           
(package private)  java.lang.Objectencoder
           
 
Constructor Summary
Format.DefaultEscapeStrategy(java.lang.String encoding)
           
 
Method Summary
 booleanshouldEscape(char ch)
          Test whether the supplied character should be formatted literally or as a character entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bits

private int bits

encoder

java.lang.Object encoder

canEncode

java.lang.reflect.Method canEncode
Constructor Detail

Format.DefaultEscapeStrategy

public Format.DefaultEscapeStrategy(java.lang.String encoding)
Method Detail

shouldEscape

public boolean shouldEscape(char ch)
Description copied from interface: EscapeStrategy
Test whether the supplied character should be formatted literally or as a character entity.

Specified by:
shouldEscape in interface EscapeStrategy