当前位置: 首页>>代码示例>>Java>>正文


Java Sequential类代码示例

本文整理汇总了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();
    }
  }
 
开发者ID:ibm-datapower,项目名称:datapower-configuration-manager,代码行数:21,代码来源:taskIf.java

示例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();
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:33,代码来源:Switch.java

示例3: addDefault

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/***
 * Creates the &lt;default&gt; tag
 */
public void addDefault(Sequential res) throws BuildException {
	if (defaultCase != null)
		throw new BuildException("Cannot specify multiple default cases");

	defaultCase = res;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:10,代码来源:Switch.java

示例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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:14,代码来源:OutOfDate.java

示例5: addTry

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
 * Adds a nested &lt;try&gt; 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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:11,代码来源:TryCatchTask.java

示例6: addFinally

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
 * Adds a nested &lt;finally&gt; 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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:11,代码来源:TryCatchTask.java

示例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;
  }
 
开发者ID:ibm-datapower,项目名称:datapower-configuration-manager,代码行数:8,代码来源:taskIf.java

示例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;
  }
 
开发者ID:ibm-datapower,项目名称:datapower-configuration-manager,代码行数:8,代码来源:taskIf.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IfElseTask.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:IfElseTask.java

示例11: createSequential

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
public Sequential createSequential() {
	this.sequential = (Sequential) getProject().createTask("sequential");
	return this.sequential;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:5,代码来源:Assert.java

示例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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:7,代码来源:IfTask.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:Funtest.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:Funtest.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:Funtest.java


注:本文中的org.apache.tools.ant.taskdefs.Sequential类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。