本文整理汇总了Java中org.apache.tools.ant.input.InputHandler类的典型用法代码示例。如果您正苦于以下问题:Java InputHandler类的具体用法?Java InputHandler怎么用?Java InputHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InputHandler类属于org.apache.tools.ant.input包,在下文中一共展示了InputHandler类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
private InputHandler getInputHandler() {
if (type != null) {
return type.getInputHandler();
}
if (refid != null) {
try {
return (InputHandler) (getProject().getReference(refid));
} catch (final ClassCastException e) {
throw new BuildException(
refid + " does not denote an InputHandler", e);
}
}
if (classname != null) {
return ClasspathUtils.newInstance(classname,
createLoader(), InputHandler.class);
}
throw new BuildException(
"Must specify refid, classname or type");
}
示例2: prompt
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
public void prompt(String message) {
InputRequest ir = new InputRequest("Debugger> ");
InputHandler ih = new DefaultInputHandler();
String command = null;
project.log(StringUtils.LINE_SEP
+ "-------- Ant Command Line Debugger --------"
+ StringUtils.LINE_SEP + StringUtils.LINE_SEP);
// print a friendly message to allow the user to understand why this
// breakpoint occurred
project.log(message);
project.log("");
// keep accepting inputs, until the user enters the return command
do {
ih.handleInput(ir);
command = ir.getInput();
commandHandler.handleCommand(command);
project.log(""); // log a new line
} while (!"return".equals(command));
// resume build execution on this
project.log(StringUtils.LINE_SEP
+ "--------- Resuming Ant Execution ----------"
+ StringUtils.LINE_SEP);
}
示例3: testInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
@Test
public void testInputHandler() {
InputHandler ih = p.getInputHandler();
assertNotNull(ih);
assertTrue(ih instanceof DefaultInputHandler);
InputHandler pfih = new PropertyFileInputHandler();
p.setInputHandler(pfih);
assertSame(pfih, p.getInputHandler());
}
示例4: testInputHandlerInheritance
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
@Test
public void testInputHandlerInheritance() {
InputHandler ih = new PropertyFileInputHandler();
buildRule.getProject().setInputHandler(ih);
InputHandlerChecker ic = new InputHandlerChecker(ih);
buildRule.getProject().addBuildListener(ic);
buildRule.executeTarget("tripleCall");
AssertionFailedError ae = ic.getError();
if (ae != null) {
throw ae;
}
buildRule.getProject().removeBuildListener(ic);
}
示例5: getInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@NotNull
public InputHandler getInputHandler()
{
return getInputHandler(getProject());
}
示例6: getInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
public InputHandler getInputHandler() {
return delegate.getInputHandler();
}
示例7: setInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
public void setInputHandler(InputHandler arg0) {
delegate.setInputHandler(arg0);
}
示例8: InputHandlerChecker
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
InputHandlerChecker(InputHandler value) {
ih = value;
}
示例9: setInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setInputHandler(@NotNull final InputHandler handler)
{
setInputHandler(handler, getProject());
}
示例10: setInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
/**
* Set the input handler.
*
* @param handler the InputHandler instance to use for gathering input.
*/
public void setInputHandler(final InputHandler handler) {
inputHandler = handler;
}
示例11: getInputHandler
import org.apache.tools.ant.input.InputHandler; //导入依赖的package包/类
/**
* Retrieve the current input handler.
*
* @return the InputHandler instance currently in place for the project
* instance.
*/
public InputHandler getInputHandler() {
return inputHandler;
}