本文整理汇总了Java中org.apache.tools.ant.Task.setTaskName方法的典型用法代码示例。如果您正苦于以下问题:Java Task.setTaskName方法的具体用法?Java Task.setTaskName怎么用?Java Task.setTaskName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.Task
的用法示例。
在下文中一共展示了Task.setTaskName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MockProject
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
public MockProject() {
task = new Task() {
public void execute() {
}
};
task.setTaskName("testTask");
target = new Target();
target.setName("testTarget");
target.setProject(this);
target.addTask(task);
task.setOwningTarget(target);
}
示例2: initTask
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Utilitary method to configure a task with the current one
*
* @param task
* task to configure
* @return the configured task
*/
protected Task initTask(Task task) {
task.setLocation(getLocation());
task.setProject(getProject());
task.setTaskName(getTaskName());
task.setOwningTarget(getOwningTarget());
return task;
}
示例3: configureTask
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
private void configureTask(Task helper) {
helper.setProject(getProject());
helper.setTaskName(getTaskName());
helper.setOwningTarget(getOwningTarget());
helper.init();
}
示例4: parseLine
import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
* Parse a line from a log file. If the line is invalid, a null will be
* returned.
*
* @param line Text to be parsed
* @param hasStack True if the line contains execution stack information
* @return Information about the log entry line
*/
public static LogEntry parseLine(String line, boolean hasStack) {
LogEntry entry = new LogEntry();
StringBuffer text = new StringBuffer(line);
try {
// Obtain the most recent date
String timestamp = text.substring(0, DATE_FORMAT.length() + 1);
SimpleDateFormat datefmt = new SimpleDateFormat(DATE_FORMAT);
entry.setDate(datefmt.parse(timestamp.trim()));
text = text.delete(0, DATE_FORMAT.length() + 1);
// Obtain the message priority
int spcIdx = text.toString().indexOf(" ");
String priority = text.substring(0, spcIdx).trim();
entry.setPriority(getPriorityAsInt(priority));
text = text.delete(0, spcIdx);
// Obtain the execution stack
if (hasStack) {
int stackBegin = text.toString().indexOf("[");
int stackEnd = text.toString().indexOf("]");
String stack = text.substring(stackBegin + 1, stackEnd).trim();
String stackEntry = null;
StringTokenizer stackTokenizer = new StringTokenizer(stack, STACK_DELIMITER);
while (stackTokenizer.hasMoreTokens()) {
stackEntry = stackTokenizer.nextToken();
int eqIdx = stackEntry.indexOf("=");
String name = stackEntry.substring(eqIdx + 1);
if (stackEntry.startsWith(PROJECT)) {
Project prj = new Project();
prj.setName(name);
entry.add(prj);
} else if (stackEntry.startsWith(TARGET)) {
Target tgt = new Target();
tgt.setName(name);
entry.add(tgt);
} else if (stackEntry.startsWith(TASK)) {
Task tsk = new DummyTask();
tsk.setTaskName(name);
entry.add(tsk);
}
}
text = text.delete(0, stackEnd + 1);
}
// Assume that the remaining text is the message
entry.setMessage(text.toString().trim());
} catch (Exception ex) {
//System.out.println("Error parsing line: " + ex);
entry = null;
}
return entry;
}