@@ -139,15 +139,15 @@ public class FixCRLF extends MatchingTask {
* <li>remove: remove all CR characters
* <li>remove: remove all CR characters
* </ul>
* </ul>
*/
*/
public void setCr(String option) {
public void setCr(AddAsisRemove attr) {
String option = attr.getValue();
if (option.equals("remove")) {
if (option.equals("remove")) {
addcr = -1;
addcr = -1;
} else if (option.equals("asis")) {
} else if (option.equals("asis")) {
addcr = 0;
addcr = 0;
} else if (option.equals("add")) {
addcr = +1;
} else {
} else {
throw new BuildException("Invalid option: " + option );
// must be "add"
addcr = +1;
}
}
}
}
@@ -161,15 +161,15 @@ public class FixCRLF extends MatchingTask {
* <li>remove: convert tabs to spaces
* <li>remove: convert tabs to spaces
* </ul>
* </ul>
*/
*/
public void setTab(String option) {
public void setTab(AddAsisRemove attr) {
String option = attr.getValue();
if (option.equals("remove")) {
if (option.equals("remove")) {
addtab = -1;
addtab = -1;
} else if (option.equals("asis")) {
} else if (option.equals("asis")) {
addtab = 0;
addtab = 0;
} else if (option.equals("add")) {
addtab = +1;
} else {
} else {
throw new BuildException("Invalid option: " + option );
// must be "add"
addtab = +1;
}
}
}
}
@@ -196,15 +196,15 @@ public class FixCRLF extends MatchingTask {
* <li>remove: remove any eof character found at the end
* <li>remove: remove any eof character found at the end
* </ul>
* </ul>
*/
*/
public void setEof(String option) {
public void setEof(AddAsisRemove attr) {
String option = attr.getValue();
if (option.equals("remove")) {
if (option.equals("remove")) {
ctrlz = -1;
ctrlz = -1;
} else if (option.equals("asis")) {
} else if (option.equals("asis")) {
ctrlz = 0;
ctrlz = 0;
} else if (option.equals("add")) {
ctrlz = +1;
} else {
} else {
throw new BuildException("Invalid option: " + option );
// must be "add"
ctrlz = +1;
}
}
}
}
@@ -370,4 +370,13 @@ public class FixCRLF extends MatchingTask {
} /* end for */
} /* end for */
}
}
/**
* Enumerated attribute with the values "asis", "add" and "remove".
*/
public static class AddAsisRemove extends EnumeratedAttribute {
public String[] getValues() {
return new String[] {"add", "asis", "remove"};
}
}
}
}