org.activemath.util
Class LineStripper
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.activemath.util.LineStripper
public class LineStripper
- extends org.apache.tools.ant.Task
A simple utility to strip the lines containing a
substring.
The attributes are:
- source: the source file
- destination: the destination file
- lineContent: the string to strip
- encoding: (optional) the encoding to be used for both reading and writing,
defaults to the platform encoding)
- force: (optional) forces the conversion ignoring modification dates
(defaults to false, that is replacement will not occur in case the
destination, if it exists, is newer than the source)
- atLineStart: wether the string is to be found at line start, defaults to false,
(note that spaces are part of this)
The input is read using any line-ending mechanism (as provided by java's java.io.LineNumberReader)
and output using the system-dependent line-ending mechanism.
- Version:
| Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
| Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
protected File source
destination
protected File destination
encoding
protected String encoding
lineContent
protected String lineContent
commentSign
protected String commentSign
atLineStart
protected boolean atLineStart
force
protected boolean force
newLine
protected static final String newLine
LineStripper
public LineStripper()
setSource
public void setSource(File file)
setDestination
public void setDestination(File file)
setEncoding
public void setEncoding(String encoding)
setLineContent
public void setLineContent(String lineContent)
setAtLineStart
public void setAtLineStart(boolean lineStart)
setForce
public void setForce(boolean force)
execute
public void execute()
throws org.apache.tools.ant.BuildException
- Overrides:
execute in class org.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
checkIsNeeded
protected boolean checkIsNeeded()
throws IOException
- Throws:
IOException