• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Node类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中groovy.util.Node的典型用法代码示例。如果您正苦于以下问题:Java Node类的具体用法?Java Node怎么用?Java Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: printNode

import groovy.util.Node; //导入依赖的package包/类
private void printNode(Node node, Writer writer) {
    final PrintWriter printWriter = new PrintWriter(writer);
    if (GUtil.isTrue(publicId)) {
        printWriter.format("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">%n", node.name(), publicId, systemId);
    }
    IndentPrinter indentPrinter = new IndentPrinter(printWriter, indentation) {
        @Override
        public void println() {
            printWriter.println();
        }
    };
    XmlNodePrinter nodePrinter = new XmlNodePrinter(indentPrinter);
    nodePrinter.setPreserveWhitespace(true);
    nodePrinter.print(node);
    printWriter.flush();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:XmlTransformer.java


示例2: addClasspathEntry

import groovy.util.Node; //导入依赖的package包/类
protected Node addClasspathEntry(Node node, Map<String, ?> attributes) {
    Map<String, Object> allAttributes = Maps.newLinkedHashMap();
    for (String key : attributes.keySet()) {
        Object value = attributes.get(key);
        if (value != null && !String.valueOf(value).isEmpty()) {
            allAttributes.put(key, value);
        }
    }
    allAttributes.put("kind", getKind());
    allAttributes.put("path", path);


    if (exported && !(this instanceof SourceFolder)) {
        allAttributes.put("exported", true);
    }

    Node entryNode = node.appendNode("classpathentry", allAttributes);
    writeAccessRules(entryNode);
    writeEntryAttributes(entryNode);
    return entryNode;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:22,代码来源:AbstractClasspathEntry.java


示例3: storeBytecodeLevels

import groovy.util.Node; //导入依赖的package包/类
private void storeBytecodeLevels() {
    Node bytecodeLevelConfiguration = findOrCreateBytecodeLevelConfiguration();
    bytecodeLevelConfiguration.attributes().put("target", bytecodeVersion.toString());
    for (IdeaModule module : modules) {
        List<Node> bytecodeLevelModules = getChildren(bytecodeLevelConfiguration, "module");
        Node moduleNode = findFirstWithAttributeValue(bytecodeLevelModules, "name", module.getName());
        JavaVersion moduleBytecodeVersionOverwrite = module.getTargetBytecodeVersion();
        if (moduleBytecodeVersionOverwrite == null) {
            if (moduleNode != null) {
                bytecodeLevelConfiguration.remove(moduleNode);
            }
        } else {
            if (moduleNode == null) {
                moduleNode = bytecodeLevelConfiguration.appendNode("module");
                moduleNode.attributes().put("name", module.getName());
            }
            moduleNode.attributes().put("target", moduleBytecodeVersionOverwrite.toString());
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:Project.java


示例4: readSourceAndExcludeFolderFromXml

import groovy.util.Node; //导入依赖的package包/类
private void readSourceAndExcludeFolderFromXml() {
    for (Node sourceFolder : findSourceFolder()) {
        String url = (String) sourceFolder.attribute("url");
        if ("false".equals(sourceFolder.attribute("isTestSource"))) {
            sourceFolders.add(pathFactory.path(url));
        } else {
            testSourceFolders.add(pathFactory.path(url));
        }
        if ("true".equals(sourceFolder.attribute("generated"))) {
            generatedSourceFolders.add(pathFactory.path(url));
        }
    }
    for (Node excludeFolder : findExcludeFolder()) {
        excludeFolders.add(pathFactory.path((String) excludeFolder.attribute("url")));
    }

}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:Module.java


示例5: toXmlNode

import groovy.util.Node; //导入依赖的package包/类
@Override
public Node toXmlNode(Node parentModule, Object name) {
    Node node = new Node(parentModule, name, path);
    if (StringUtils.isNotEmpty(altDeployDescriptor)) {
        new Node(parentModule, nodeNameFor("alt-dd", name), altDeployDescriptor);
    }
    return node;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultEarModule.java


示例6: toXmlNode

import groovy.util.Node; //导入依赖的package包/类
@Override
public Node toXmlNode(Node parentModule, Object name) {
    Node web = new Node(parentModule, name);
    new Node(web, nodeNameFor("web-uri", name), getPath());
    new Node(web, nodeNameFor("context-root", name), contextRoot);
    if (StringUtils.isNotEmpty(getAltDeployDescriptor())) {
        return new Node(parentModule, nodeNameFor("alt-dd", name), getAltDeployDescriptor());
    }
    return null;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultEarWebModule.java


示例7: childNodeText

import groovy.util.Node; //导入依赖的package包/类
private static String childNodeText(Node root, String name) {
    for (Node child : Cast.<List<Node>>uncheckedCast(root.children())) {
        if (localNameOf(child).equals(name)) {
            return child.text();
        }
    }
    return null;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultDeploymentDescriptor.java


示例8: appendNode

import groovy.util.Node; //导入依赖的package包/类
@Override
public void appendNode(Node node) {
    Map<String, Object> attributes = Maps.newHashMap();
    attributes.put("deploy-path", deployPath);
    attributes.put("source-path", sourcePath);
    node.appendNode("wb-resource", attributes);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:WbResource.java


示例9: appendNode

import groovy.util.Node; //导入依赖的package包/类
public void appendNode(Node node) {
    Map<String, Object> attributes = Maps.newHashMap();
    attributes.put("facet", name);
    if (type == FacetType.installed) {
        attributes.put("version", version);
    }
    node.appendNode(type.name(), attributes);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:Facet.java


示例10: store

import groovy.util.Node; //导入依赖的package包/类
@Override
protected void store(Node xml) {
    removeConfigurableDataFromXml();
    Node wbModuleNode = getWbModuleNode(xml);
    wbModuleNode.attributes().put("deploy-name", deployName);
    if (!isNullOrEmpty(contextPath)) {
        new WbProperty("context-root", contextPath).appendNode(wbModuleNode);
    }
    for (WbModuleEntry wbModuleEntry : wbModuleEntries) {
        wbModuleEntry.appendNode(wbModuleNode);
    }

}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:WtpComponent.java


示例11: removeConfigurableDataFromXml

import groovy.util.Node; //导入依赖的package包/类
private void removeConfigurableDataFromXml() {
    Node wbModuleNode = getWbModuleNode(getXml());
    for (String elementName : Arrays.asList("property", "wb-resource", "dependent-module")) {
        for (Node elementNode : XmlPersistableConfigurationObject.getChildren(wbModuleNode, elementName)) {
            wbModuleNode.remove(elementNode);
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:WtpComponent.java


示例12: appendNode

import groovy.util.Node; //导入依赖的package包/类
@Override
public void appendNode(Node node) {
    Map<String, Object> attributes = Maps.newHashMap();
    attributes.put("kind", getKind());
    attributes.put("path", path);
    node.appendNode("classpathentry", attributes);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:Output.java


示例13: load

import groovy.util.Node; //导入依赖的package包/类
@Override
protected void load(Node xml) {
    Node nameNode = findFirstChildNamed(xml, "name");
    name = nameNode != null ? nameNode.text() : "";
    Node commentNode = findFirstChildNamed(xml, "comment");
    comment = commentNode != null ? commentNode.text() : "";
    readReferencedProjects();
    readNatures();
    readBuildCommands();
    readLinkedResources();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:Project.java


示例14: readBuildCommands

import groovy.util.Node; //导入依赖的package包/类
private void readBuildCommands() {
    for (Node commandNode : getChildren(findFirstChildNamed(getXml(), "buildSpec"), "buildCommand")) {
        String name = findFirstChildNamed(commandNode, "name").text();
        Map<String, String> arguments = Maps.newHashMap();
        for (Node dictionaryNode : getChildren(findFirstChildNamed(commandNode, "arguments"), "dictionary")) {
            String key = findFirstChildNamed(dictionaryNode, "key").text();
            String value = findFirstChildNamed(dictionaryNode, "value").text();
            arguments.put(key, value);
        }
        buildCommands.add(new BuildCommand(name, arguments));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:Project.java


示例15: store

import groovy.util.Node; //导入依赖的package包/类
@Override
protected void store(Node xml) {
    for (String childNodeName : Arrays.asList("name", "comment", "projects", "natures", "buildSpec", "linkedResources")) {
        Node childNode = findFirstChildNamed(xml, childNodeName);
        if (childNode != null) {
            xml.remove(childNode);
        }
    }
    xml.appendNode("name", nullToEmpty(name));
    xml.appendNode("comment", nullToEmpty(comment));
    addReferencedProjectsToXml();
    addNaturesToXml();
    addBuildSpecToXml();
    addLinkedResourcesToXml();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:Project.java


示例16: addBuildSpecToXml

import groovy.util.Node; //导入依赖的package包/类
private void addBuildSpecToXml() {
    Node buildSpec = getXml().appendNode("buildSpec");
    for (BuildCommand command : buildCommands) {
        Node commandNode = buildSpec.appendNode("buildCommand");
        commandNode.appendNode("name", command.getName());
        Node argumentsNode = commandNode.appendNode("arguments");
        for (Map.Entry<String, String> argument : command.getArguments().entrySet()) {
            Node dictionaryNode = argumentsNode.appendNode("dictionary");
            dictionaryNode.appendNode("key", argument.getKey());
            dictionaryNode.appendNode("value", argument.getValue());
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:Project.java


示例17: addLinkedResourcesToXml

import groovy.util.Node; //导入依赖的package包/类
private void addLinkedResourcesToXml() {
    Node parent = getXml().appendNode("linkedResources");
    for (Link link : linkedResources) {
        Node linkNode = parent.appendNode("link");
        linkNode.appendNode("name", link.getName());
        linkNode.appendNode("type", link.getType());
        if (!isNullOrEmpty(link.getLocation())) {
            linkNode.appendNode("location", link.getLocation());
        }
        if (!isNullOrEmpty(link.getLocationUri())) {
            linkNode.appendNode("locationURI", link.getLocationUri());
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:Project.java


示例18: AbstractClasspathEntry

import groovy.util.Node; //导入依赖的package包/类
public AbstractClasspathEntry(Node node) {
    path = normalizePath((String) node.attribute("path"));
    this.exported = isNodeExported(node);
    accessRules = readAccessRules(node);
    entryAttributes = readEntryAttributes(node);
    Preconditions.checkNotNull(path);
    Preconditions.checkNotNull(accessRules);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:AbstractClasspathEntry.java


示例19: isNodeExported

import groovy.util.Node; //导入依赖的package包/类
private boolean isNodeExported(Node node) {
    Object value = node.attribute("exported");
    if (value == null) {
        return false;
    } else if (value instanceof Boolean) {
        return ((Boolean) value).booleanValue();
    } else {
        return Boolean.valueOf((String) value);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:AbstractClasspathEntry.java


示例20: readEntryAttributes

import groovy.util.Node; //导入依赖的package包/类
private Map<String, Object> readEntryAttributes(Node node) {
    Map<String, Object> attributes = Maps.newLinkedHashMap();
    NodeList attributesNodes = (NodeList) node.get("attributes");
    for (Object attributesEntry : attributesNodes) {
        NodeList attributeNodes = (NodeList) ((Node) attributesEntry).get("attribute");
        for (Object attributeEntry : attributeNodes) {
            Node attributeNode = (Node) attributeEntry;
            attributes.put((String) attributeNode.attribute("name"), attributeNode.attribute("value"));
        }
    }
    return attributes;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:AbstractClasspathEntry.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HyphenateException类代码示例发布时间:2022-05-22
下一篇:
Java Strings类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap