本文整理了Java中groovy.util.AntBuilder.onDefineTarget()
方法的一些代码示例,展示了AntBuilder.onDefineTarget()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AntBuilder.onDefineTarget()
方法的具体详情如下:
包路径:groovy.util.AntBuilder
类名称: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();
}
内容来源于网络,如有侵权,请联系作者删除!