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


Java BuildEvent.getTarget方法代码示例

本文整理汇总了Java中org.apache.tools.ant.BuildEvent.getTarget方法的典型用法代码示例。如果您正苦于以下问题:Java BuildEvent.getTarget方法的具体用法?Java BuildEvent.getTarget怎么用?Java BuildEvent.getTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.BuildEvent的用法示例。


在下文中一共展示了BuildEvent.getTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * @see BuildListener#messageLogged
 * {@inheritDoc}.
 */
@Override
public void messageLogged(final BuildEvent event) {
    Object categoryObject = event.getTask();
    if (categoryObject == null) {
        categoryObject = event.getTarget();
        if (categoryObject == null) {
            categoryObject = event.getProject();
        }
    }

    final Logger log
        = Logger.getLogger(categoryObject.getClass().getName());
    switch (event.getPriority()) {
        case Project.MSG_ERR:
            log.error(event.getMessage());
            break;
        case Project.MSG_WARN:
            log.warn(event.getMessage());
            break;
        case Project.MSG_INFO:
            log.info(event.getMessage());
            break;
        case Project.MSG_VERBOSE:
            log.debug(event.getMessage());
            break;
        case Project.MSG_DEBUG:
            log.debug(event.getMessage());
            break;
        default:
            log.error(event.getMessage());
            break;
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:38,代码来源:Log4jListener.java

示例2: messageLogged

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
/**
 * @see BuildListener#messageLogged
 * {@inheritDoc}.
 */
@Override
public void messageLogged(final BuildEvent event) {
    if (initialized) {
        Object categoryObject = event.getTask();
        String categoryString;
        String categoryDetail = null;

        if (categoryObject == null) {
            categoryObject = event.getTarget();
            if (categoryObject == null) {
                categoryString = PROJECT_LOG;
                categoryDetail = event.getProject().getName();
            } else {
                categoryString = TARGET_LOG;
                categoryDetail = event.getTarget().getName();
            }
        } else {
            // It's a task - append the target
            if (event.getTarget() != null) {
                categoryString = categoryObject.getClass().getName();
                categoryDetail = event.getTarget().getName();
            } else {
                categoryString = categoryObject.getClass().getName();
            }

        }

        final Log log = getLog(categoryString, categoryDetail);
        final int priority = event.getPriority();
        final String message = event.getMessage();
        realLog(log, message, priority, null);
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:38,代码来源:CommonsLoggingListener.java

示例3: targetStarted

import org.apache.tools.ant.BuildEvent; //导入方法依赖的package包/类
public void targetStarted(BuildEvent event) {
	currentTarget = event.getTarget();
	Target target = event.getTarget();
	if (debugtargets.contains(target.getName())) {
		prompt.prompt("Break Point at Target: " + target.getName());
	}
}
 
开发者ID:apache,项目名称:ant-easyant-tasks,代码行数:8,代码来源:DebuggerListener.java


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