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


Java Task.setTaskName方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:ant,代码行数:13,代码来源:ModifiedSelectorTest.java

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

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

示例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;
    }
 
开发者ID:ModelN,项目名称:build-management,代码行数:64,代码来源:LineLogger.java


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