本文整理汇总了Java中org.apache.tools.ant.taskdefs.Sequential类的典型用法代码示例。如果您正苦于以下问题:Java Sequential类的具体用法?Java Sequential怎么用?Java Sequential使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sequential类属于org.apache.tools.ant.taskdefs包,在下文中一共展示了Sequential类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public void execute() throws BuildException {
// Ensure that exactly one condition was specified.
int numConditions = countConditions();
if (numConditions != 1) {
throw new BuildException("An 'if' must have exactly one condition (e.g. equal, and, etc.) - this 'if' has " + numConditions);
}
// Ensure that either a 'then' or an 'else' was specified. An 'if' without one or the other is useless and probably a mistake.
if ((seqThen == null) && (seqElse == null)) {
throw new BuildException("An 'if' must have a 'then' and/or 'else' - this 'if' has neither.");
}
// Evaluate the condition and either do the 'then' or the 'else'.
Condition condition = (Condition) getConditions().nextElement();
Sequential task = condition.eval() ? seqThen : seqElse;
if (task != null) {
task.execute();
}
}
示例2: execute
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public void execute() throws BuildException {
if (value == null)
throw new BuildException("Value is missing");
if (cases.size() == 0 && defaultCase == null)
throw new BuildException("No cases supplied");
Sequential selectedCase = defaultCase;
int sz = cases.size();
for (int i = 0; i < sz; i++) {
Case c = (Case) (cases.elementAt(i));
String cvalue = c.value;
if (cvalue == null) {
throw new BuildException("Value is required for case.");
}
String mvalue = value;
if (caseInsensitive) {
cvalue = cvalue.toUpperCase();
mvalue = mvalue.toUpperCase();
}
if (cvalue.equals(mvalue) && c != defaultCase)
selectedCase = c;
}
if (selectedCase == null) {
throw new BuildException("No case matched the value " + value + " and no default has been specified.");
}
selectedCase.perform();
}
示例3: addDefault
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/***
* Creates the <default> tag
*/
public void addDefault(Sequential res) throws BuildException {
if (defaultCase != null)
throw new BuildException("Cannot specify multiple default cases");
defaultCase = res;
}
示例4: addSequential
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Embedded do sequential.
*
* @param doTask
* the sequential to embed
*/
public void addSequential(Sequential doTask) {
if (this.doTask != null) {
throw new BuildException(
"You must not nest more that one <parallel> or <sequential>" + " into <outofdate>");
}
this.doTask = doTask;
}
示例5: addTry
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Adds a nested <try> block - one is required, more is forbidden.
*/
public void addTry(Sequential seq) throws BuildException {
if (tryTasks != null) {
throw new BuildException("You must not specify more than one <try>");
}
tryTasks = seq;
}
示例6: addFinally
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Adds a nested <finally> block - at most one is allowed.
*/
public void addFinally(Sequential seq) throws BuildException {
if (finallyTasks != null) {
throw new BuildException("You must not specify more than one <finally>");
}
finallyTasks = seq;
}
示例7: addThen
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public void addThen(Sequential task) {
if (seqThen != null) {
throw new BuildException("An 'if' task can have only one 'then'.");
}
seqThen = task;
}
示例8: addElse
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public void addElse(Sequential task) {
if (seqElse != null) {
throw new BuildException("An 'if' task can have only one 'else'.");
}
seqElse = task;
}
示例9: createThen
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Creates and returns the <then> {@link Sequential}
*/
public Object createThen() {
mThen = new Sequential();
return mThen;
}
示例10: createElse
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Creates and returns the <else> {@link Sequential}
*/
public Object createElse() {
mElse = new Sequential();
return mElse;
}
示例11: createSequential
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public Sequential createSequential() {
this.sequential = (Sequential) getProject().createTask("sequential");
return this.sequential;
}
示例12: addThen
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public void addThen(Sequential t) {
if (thenTasks != null) {
throw new BuildException("You must not nest more than one <then> into <elseif>");
}
thenTasks = t;
}
示例13: addApplication
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Add an application.
* @param sequence the application to add.
*/
public void addApplication(Sequential sequence) {
logOverride("application", application);
application = sequence;
}
示例14: addSetup
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* Add a setup sequence.
* @param sequence the setup sequence to add.
*/
public void addSetup(Sequential sequence) {
logOverride("setup", setup);
setup = sequence;
}
示例15: addTests
import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
* add tests.
* @param sequence a sequence to add.
*/
public void addTests(Sequential sequence) {
logOverride("tests", tests);
tests = sequence;
}