Top Description Fields Constructors Methods
org.apache.tools.ant.filters

public Class EscapeUnicode

extends BaseParamFilterReader
implements ChainableReader
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.filters.ChainableReader
Imports
java.io.IOException, .Reader, org.apache.tools.ant.util.UnicodeUtil

This method converts non-latin characters to unicode escapes. Useful to load properties containing non latin Example:
<escapeunicode>
Or:
<filterreader
       classname="org.apache.tools.ant.filters.EscapeUnicode"/>
 
Since
Ant 1.6

Field Summary

Modifier and TypeField and Description
private StringBuffer

Constructor Summary

AccessConstructor and Description
public
EscapeUnicode()

Constructor for "dummy" instances.

public
EscapeUnicode(final Reader
A Reader object providing the underlying stream. Must not be null.
in
)

Creates a new filtered reader.

Method Summary

Modifier and TypeMethod and Description
public final Reader

Returns:

a new filter based on this configuration, but filtering the specified reader
chain
(final Reader
A Reader object providing the underlying stream. Must not be null.
rdr
)

Implements org.apache.tools.ant.filters.ChainableReader.chain.

Creates a new EscapeUnicode using the passed in Reader for instantiation.
private void
initialize()

Parses the parameters (currently unused)

public final int

Returns:

the next character in the resulting stream, or -1 if the end of the resulting stream has been reached
read
()

Overrides java.io.FilterReader.read.

Returns the next character in the filtered stream, converting non latin characters to unicode escapes.
Inherited from org.apache.tools.ant.filters.BaseParamFilterReader:
getParameterssetParameters

Field Detail

unicodeBufback to summary
private StringBuffer unicodeBuf

Constructor Detail

EscapeUnicodeback to summary
public EscapeUnicode()

Constructor for "dummy" instances.

See Also
BaseFilterReader#BaseFilterReader()
EscapeUnicodeback to summary
public EscapeUnicode(final Reader in)

Creates a new filtered reader.

Parameters
in:Reader

A Reader object providing the underlying stream. Must not be null.

Method Detail

chainback to summary
public final Reader chain(final Reader rdr)

Implements org.apache.tools.ant.filters.ChainableReader.chain.

Creates a new EscapeUnicode using the passed in Reader for instantiation.

Parameters
rdr:Reader

A Reader object providing the underlying stream. Must not be null.

Returns:Reader

a new filter based on this configuration, but filtering the specified reader

initializeback to summary
private void initialize()

Parses the parameters (currently unused)

readback to summary
public final int read() throws IOException

Overrides java.io.FilterReader.read.

Returns the next character in the filtered stream, converting non latin characters to unicode escapes.

Returns:int

the next character in the resulting stream, or -1 if the end of the resulting stream has been reached

Exceptions
IOException:
if the underlying stream throws an IOException during reading