ExpandPropertiespublic final class ExpandProperties extends BaseFilterReader implements ChainableReaderExpands Ant properties, if any, in the data.
Example:
<expandproperties/>
Or:
<filterreader
classname="org.apache.tools.ant.filters.ExpandProperties"/> |
Fields Summary |
---|
private String | queuedDataData that must be read from, if not null. |
Constructors Summary |
---|
public ExpandProperties()Constructor for "dummy" instances.
super();
| public ExpandProperties(Reader in)Creates a new filtered reader.
super(in);
|
Methods Summary |
---|
public java.io.Reader | chain(java.io.Reader rdr)Creates a new ExpandProperties filter using the passed in
Reader for instantiation.
ExpandProperties newFilter = new ExpandProperties(rdr);
newFilter.setProject(getProject());
return newFilter;
| public int | read()Returns the next character in the filtered stream. The original
stream is first read in fully, and the Ant properties are expanded.
The results of this expansion are then queued so they can be read
character-by-character.
int ch = -1;
if (queuedData != null && queuedData.length() == 0) {
queuedData = null;
}
if (queuedData != null) {
ch = queuedData.charAt(0);
queuedData = queuedData.substring(1);
if (queuedData.length() == 0) {
queuedData = null;
}
} else {
queuedData = readFully();
if (queuedData == null) {
ch = -1;
} else {
Project project = getProject();
queuedData = project.replaceProperties(queuedData);
return read();
}
}
return ch;
|
|