|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Class Summary | |
|---|---|
| CodeStripper | CodeStripper acts as a filter and removes code between start and end tag. |
| Parents | Creates File with directory parents for a file |
codestripper.
The initial purpose of codestripper is to remove code (solutions)
form exam questions, such that tried and tested solutions code
could be stripped and used as initial code for exam questions.| property | Description | default value |
|---|---|---|
| deletelines | deletes lines if set. Otherwise replaces original
lines with newline-characters in output file. | false |
| dir | input directory | "." |
| todir | output dir. | "out" |
| starttag | start stripping token. | ^\\s∗//Start Solution |
| endtag | end stripping token. | ^\\s∗//End Solution. |
| dryRun | dryRun to test to test ant task. | false |
| replaceTag | This allows means to replace the start and end lines with
some other text, typically with //TODO for start and return 0; for end.
Any leading white space (indentation) is preserved. |
::replacewith:: |
<target name="strip">
<codestripper todir="../examproject"
dir="src"
deletelines="true"
includes="**/*.java"
excludes="**/Parents.java"
/>
</target>
The tags in the code (using the defaults) could look like this (the strikethrough is not in the
code or in the result, but rather shows what code would be removed):
private File makeOutputFile(String arg) {
//Start Solution::replacewith:://TODO
File f = new File(arg);
String parent = f.getParent();
System.out.println(f.getName());
String fullOutPath = "out/" + arg;
if (parent != null) {
System.out.println(parent);
File outDir = new File("out/" + parent);
outDir.mkdirs();
}
File result = new File(fullOutPath);
return result;
//End Solution::replacewith::return null;
}
Authors: Pieter van den Hombergh, Ferd van Odenhoven
|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||