groovy.util.AntBuilder.onDefineTarget()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中groovy.util.AntBuilder.onDefineTarget()方法的一些代码示例,展示了AntBuilder.onDefineTarget()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AntBuilder.onDefineTarget()方法的具体详情如下:
包路径:groovy.util.AntBuilder
类名称:AntBuilder
方法名:onDefineTarget

AntBuilder.onDefineTarget介绍

暂无

代码示例

代码示例来源:origin: apache/groovy

protected Object createNode(final Object name, final Map attributes) {
  final Attributes attrs = buildAttributes(attributes);
  String tagName = name.toString();
  String ns = "";
  if (name instanceof QName) {
    QName q = (QName) name;
    tagName = q.getLocalPart();
    ns = q.getNamespaceURI();
  }
  // import can be used only as top level element
  if ("import".equals(name)) {
    antXmlContext.setCurrentTarget(implicitTarget);
  } else if ("target".equals(name) && !insideTask) {
    return onStartTarget(attrs, tagName, ns);
  } else if ("defineTarget".equals(name) && !insideTask) {
    return onDefineTarget(attrs, "target", ns);
  }
  try {
    antElementHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext);
  }
  catch (final SAXParseException e) {
    log.log(Level.SEVERE, "Caught: " + e, e);
  }
  insideTask = true;
  final RuntimeConfigurable wrapper = antXmlContext.getWrapperStack().lastElement();
  return wrapper.getProxy();
}

代码示例来源:origin: org.codehaus.groovy/groovy-ant

protected Object createNode(final Object name, final Map attributes) {
  final Attributes attrs = buildAttributes(attributes);
  String tagName = name.toString();
  String ns = "";
  if (name instanceof QName) {
    QName q = (QName) name;
    tagName = q.getLocalPart();
    ns = q.getNamespaceURI();
  }
  // import can be used only as top level element
  if ("import".equals(name)) {
    antXmlContext.setCurrentTarget(implicitTarget);
  } else if ("target".equals(name) && !insideTask) {
    return onStartTarget(attrs, tagName, ns);
  } else if ("defineTarget".equals(name) && !insideTask) {
    return onDefineTarget(attrs, "target", ns);
  }
  try {
    antElementHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext);
  }
  catch (final SAXParseException e) {
    log.log(Level.SEVERE, "Caught: " + e, e);
  }
  insideTask = true;
  final RuntimeConfigurable wrapper = antXmlContext.getWrapperStack().lastElement();
  return wrapper.getProxy();
}

相关文章