• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Sequential类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.tools.ant.taskdefs.Sequential的典型用法代码示例。如果您正苦于以下问题:Java Sequential类的具体用法?Java Sequential怎么用?Java Sequential使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Sequential类属于org.apache.tools.ant.taskdefs包,在下文中一共展示了Sequential类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: addReporting

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
 * set reporting sequence of tasks.
 * @param sequence a reporting sequence to use.
 */
public void addReporting(Sequential sequence) {
    logOverride("reporting", reporting);
    reporting = sequence;
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:Funtest.java


示例17: addTeardown

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
 * set teardown sequence of tasks.
 * @param sequence a teardown sequence to use.
 */
public void addTeardown(Sequential sequence) {
    logOverride("teardown", teardown);
    teardown = sequence;
}
 
开发者ID:apache,项目名称:ant,代码行数:9,代码来源:Funtest.java


示例18: addElse

import org.apache.tools.ant.taskdefs.Sequential; //导入依赖的package包/类
/**
 * A nested &lt;else&gt; element - a container of tasks that will be run if
 * the condition doesn't hold true.
 *
 * <p>
 * Not required.
 * </p>
 */
public void addElse(Sequential e) {
	if (elseTasks != null) {
		throw new BuildException("You must not nest more than one <else> into <if>");
	}
	elseTasks = e;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:15,代码来源:IfTask.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Core类代码示例发布时间:2022-05-22
下一篇:
Java TableTagParameters类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap