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

public final Class StripLineBreaks

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

Filter to flatten the stream to a single line. Example:
<striplinebreaks/>
Or:
<filterreader
  classname="org.apache.tools.ant.filters.StripLineBreaks"/>

Field Summary

Modifier and TypeField and Description
private static final String
DEFAULT_LINE_BREAKS

Line-breaking characters.

private static final String
LINE_BREAKS_KEY

Parameter name for the line-breaking characters parameter.

private String
lineBreaks

The characters that are recognized as line breaks.

Constructor Summary

AccessConstructor and Description
public
StripLineBreaks()

Constructor for "dummy" instances.

public
StripLineBreaks(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 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 StripLineBreaks using the passed in Reader for instantiation.
private String

Returns:

a String containing all the characters considered as line-breaking
getLineBreaks
()

Returns the line-breaking characters as a String.

private void
initialize()

Parses the parameters to set the line-breaking characters.

public 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, only including characters not in the set of line-breaking characters.
public void
setLineBreaks(final String
A String containing all the characters to be considered as line-breaking.
lineBreaks
)

Sets the line-breaking characters.

Inherited from org.apache.tools.ant.filters.BaseParamFilterReader:
getParameterssetParameters

Field Detail

DEFAULT_LINE_BREAKSback to summary
private static final String DEFAULT_LINE_BREAKS

Line-breaking characters. What should we do on funny IBM mainframes with odd line endings?

LINE_BREAKS_KEYback to summary
private static final String LINE_BREAKS_KEY

Parameter name for the line-breaking characters parameter.

lineBreaksback to summary
private String lineBreaks

The characters that are recognized as line breaks.

Constructor Detail

StripLineBreaksback to summary
public StripLineBreaks()

Constructor for "dummy" instances.

See Also
BaseFilterReader#BaseFilterReader()
StripLineBreaksback to summary
public StripLineBreaks(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 Reader chain(final Reader rdr)

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

Creates a new StripLineBreaks 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

getLineBreaksback to summary
private String getLineBreaks()

Returns the line-breaking characters as a String.

Returns:String

a String containing all the characters considered as line-breaking

initializeback to summary
private void initialize()

Parses the parameters to set the line-breaking characters.

readback to summary
public int read() throws IOException

Overrides java.io.FilterReader.read.

Returns the next character in the filtered stream, only including characters not in the set of line-breaking characters.

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
setLineBreaksback to summary
public void setLineBreaks(final String lineBreaks)

Sets the line-breaking characters.

Parameters
lineBreaks:String

A String containing all the characters to be considered as line-breaking.