intarsys runtime library

de.intarsys.tools.reader
Class UnEscapeReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by de.intarsys.tools.reader.UnEscapeReader
All Implemented Interfaces:
IUnEscaper, Closeable, Readable

public class UnEscapeReader
extends FilterReader
implements IUnEscaper

A reader that can unescape character data from a wrapped reader.


Field Summary
static char DefaultEscape
           
 
Constructor Summary
UnEscapeReader(Reader in)
           
UnEscapeReader(Reader in, char escape, Map map)
           
UnEscapeReader(Reader in, Map map)
           
 
Method Summary
 void addEscapedCharacter(char key, char value)
           
 void close()
           
 char getEscape()
           
 Map getEscapeMap()
           
 char getUnicodePrefix()
           
 boolean isMapped()
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
 void removeEscapedCharacter(char key)
           
 void removeEscapedCharacters()
           
 void setEscape(char newEscape)
           
 void setUnicodePrefix(char newUniChar)
           
 long skip(long n)
           
static String unescape(String in)
           
 
Methods inherited from class java.io.FilterReader
mark, markSupported, ready, reset
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultEscape

public static final char DefaultEscape
See Also:
Constant Field Values
Constructor Detail

UnEscapeReader

public UnEscapeReader(Reader in)

UnEscapeReader

public UnEscapeReader(Reader in,
                      char escape,
                      Map map)

UnEscapeReader

public UnEscapeReader(Reader in,
                      Map map)
Method Detail

unescape

public static String unescape(String in)
                       throws IOException
Throws:
IOException

addEscapedCharacter

public void addEscapedCharacter(char key,
                                char value)
Specified by:
addEscapedCharacter in interface IUnEscaper

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterReader
Throws:
IOException

getEscape

public char getEscape()

getEscapeMap

public Map getEscapeMap()

getUnicodePrefix

public char getUnicodePrefix()

isMapped

public boolean isMapped()
Specified by:
isMapped in interface IUnEscaper

read

public int read()
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterReader
Throws:
IOException

removeEscapedCharacter

public void removeEscapedCharacter(char key)

removeEscapedCharacters

public void removeEscapedCharacters()

setEscape

public void setEscape(char newEscape)
Specified by:
setEscape in interface IUnEscaper

setUnicodePrefix

public void setUnicodePrefix(char newUniChar)

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class FilterReader
Throws:
IOException

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.