<striplinecomments> <comment value="#"/> <comment value="--"/> <comment value="REM "/> <comment value="rem "/> <comment value="//"/> </striplinecomments>Or:
<filterreader classname="org.apache.tools.ant.filters.StripLineComments"> <param type="comment" value="#"/> <param type="comment" value="--"/> <param type="comment" value="REM "/> <param type="comment" value="rem "/> <param type="comment" value="//"/> </filterreader>
Modifier and Type | Class and Description |
---|---|
public static class | StripLineComments.Comment
The class that holds a comment representation. |
Modifier and Type | Field and Description |
---|---|
private Vector | comments
Vector that holds the comment prefixes. |
private static final String | COMMENTS_KEY
Parameter name for the comment prefix. |
private String | line
The line that has been read ahead. |
Access | Constructor and Description |
---|---|
public | |
public | StripLineComments(final Reader
A Reader object providing the underlying stream.
Must not be in)null .Creates a new filtered reader. |
Modifier and Type | Method and Description |
---|---|
public void | addConfiguredComment(final StripLineComments.
The commentcomment element to add to the
list of comment prefixes to strip. Must not be null .Adds a |
public Reader | Returns: a new filter based on this configuration, but filtering the specified readerA Reader object providing the underlying stream.
Must not be rdr)null .Implements org. |
private Vector | Returns: the list of comment prefixes to strip.Returns the list of comment prefixes to strip. |
private void | |
public int | Returns: the next character in the resulting stream, or -1 if the end of the resulting stream has been reachedOverrides java. |
private void | setComments(final Vector<String>
A list of strings, each of which is a prefix
for a comment line. Must not be comments)null .Sets the list of comment prefixes to strip. |
comments | back to summary |
---|---|
private Vector<String> comments Vector that holds the comment prefixes. |
COMMENTS_KEY | back to summary |
---|---|
private static final String COMMENTS_KEY Parameter name for the comment prefix. |
line | back to summary |
---|---|
private String line The line that has been read ahead. |
StripLineComments | back to summary |
---|---|
public StripLineComments() Constructor for "dummy" instances.
|
StripLineComments | back to summary |
---|---|
public StripLineComments(final Reader in) Creates a new filtered reader.
|
addConfiguredComment | back to summary |
---|---|
public void addConfiguredComment(final StripLineComments. Adds a
|
chain | back to summary |
---|---|
public Reader chain(final Reader rdr) Implements org. Creates a new StripLineComments using the passed in Reader for instantiation. |
getComments | back to summary |
---|---|
private Vector Returns the list of comment prefixes to strip. |
initialize | back to summary |
---|---|
private void initialize() Parses the parameters to set the comment prefixes. |
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Returns the next character in the filtered stream, only including lines from the original stream which don't start with any of the specified comment prefixes.
|
setComments | back to summary |
---|---|
private void setComments(final Vector<String> comments) Sets the list of comment prefixes to strip. |
Modifier and Type | Field and Description |
---|---|
private String | value
The prefix for a line comment. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | |
public final String | Returns: the prefix for this type of line comment.Returns the prefix for this type of line comment. |
public final void |
value | back to summary |
---|---|
private String value The prefix for a line comment. |
Comment | back to summary |
---|---|
public Comment() |
addText | back to summary |
---|---|
public void addText(String comment) Alt. syntax to set the prefix for this type of line comment.
|
getValue | back to summary |
---|---|
public final String getValue() Returns the prefix for this type of line comment.
|
setValue | back to summary |
---|---|
public final void setValue(String comment) Sets the prefix for this type of line comment.
|