本文整理了Java中org.jboss.shrinkwrap.descriptor.spi.node.Node.getName()
方法的一些代码示例,展示了Node.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getName()
方法的具体详情如下:
包路径:org.jboss.shrinkwrap.descriptor.spi.node.Node
类名称:Node
方法名:getName
[英]Get the Nodes name.
[中]获取节点名称。
代码示例来源:origin: io.thorntail/tools
public ModuleAnalyzer(InputStream in) throws IOException {
NodeImporter importer = new XmlDomNodeImporterImpl();
Node node = importer.importAsNode(in, true);
String rootName = node.getName();
if (rootName.equals("module")) {
this.module = new ModuleDescriptorImpl(null, node);
}
in.close();
}
代码示例来源:origin: org.wildfly.swarm/tools
public ModuleAnalyzer(InputStream in) throws IOException {
NodeImporter importer = new XmlDomNodeImporterImpl();
Node node = importer.importAsNode(in, true);
String rootName = node.getName();
if (rootName.equals("module")) {
this.module = new ModuleDescriptorImpl(null, node);
}
in.close();
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Returns a multiline {@link String} format of this {@link Node} and all children
*
* @param verbose
* @return
*/
public String toString(final boolean verbose) {
if (!verbose) {
return this.toString();
}
final StringBuilder sb = new StringBuilder();
sb.append("Listing of ");
sb.append(Node.class.getSimpleName());
sb.append(" starting at: ");
sb.append(this.getName());
sb.append('\n');
this.appendNodeInfo(sb, 0, this);
return sb.toString();
}
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Returns a multiline {@link String} format of this {@link Node} and all children
*
* @param verbose
* @return
*/
public String toString(final boolean verbose) {
if (!verbose) {
return this.toString();
}
final StringBuilder sb = new StringBuilder();
sb.append("Listing of ");
sb.append(Node.class.getSimpleName());
sb.append(" starting at: ");
sb.append(this.getName());
sb.append('\n');
this.appendNodeInfo(sb, 0, this);
return sb.toString();
}
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
private void appendNodeInfo(final StringBuilder builder, final int level, final Node node) {
final StringBuilder indent = new StringBuilder();
for (int i = 0; i < level; i++) {
indent.append('-');
}
builder.append(indent);
builder.append('+');
builder.append(SPACE);
builder.append(node.getName());
builder.append('(');
builder.append(node.attributes);
builder.append(')');
final String nodeText = node.getText();
if (nodeText != null) {
builder.append(SPACE);
builder.append(node.getText());
}
builder.append('\n');
for (final Node child : node.children) {
this.appendNodeInfo(builder, level + 1, child);
}
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
private void appendNodeInfo(final StringBuilder builder, final int level, final Node node) {
final StringBuilder indent = new StringBuilder();
for (int i = 0; i < level; i++) {
indent.append('-');
}
builder.append(indent);
builder.append('+');
builder.append(SPACE);
builder.append(node.getName());
builder.append('(');
builder.append(node.attributes);
builder.append(')');
final String nodeText = node.getText();
if (nodeText != null) {
builder.append(SPACE);
builder.append(node.getText());
}
builder.append('\n');
for (final Node child : node.children) {
this.appendNodeInfo(builder, level + 1, child);
}
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Returns a deep copy of this {@link Node}
*
* @return
*/
public Node deepCopy() {
// Create new Node
final Node newRoot = new Node(this.getName());
// Set attributes
this.deepCopy(newRoot);
// Return
return newRoot;
}
代码示例来源:origin: wildfly-swarm-archive/ARCHIVE-wildfly-swarm
public ModuleAnalyzer(InputStream in) throws IOException {
NodeImporter importer = new XmlDomNodeImporterImpl();
Node node = importer.importAsNode(in, true);
String rootName = node.getName();
if (rootName.equals("module")) {
this.module = new ModuleDescriptorImpl(null, node);
}
in.close();
}
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Returns a deep copy of this {@link Node}
*
* @return
*/
public Node deepCopy() {
// Create new Node
final Node newRoot = new Node(this.getName());
// Set attributes
this.deepCopy(newRoot);
// Return
return newRoot;
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
if (!name.equals(node.getName())) {
return false;
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
if (!name.equals(node.getName())) {
return false;
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
targetChild = owned.createComment(source.getText());
} else if (source.getText() != null) {
targetChild = owned.createElement(source.getName());
targetChild.appendChild(owned.createTextNode(source.getText()));
} else {
targetChild = owned.createElement(source.getName());
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
targetChild = owned.createComment(source.getText());
} else if (source.getText() != null) {
targetChild = owned.createElement(source.getName());
targetChild.appendChild(owned.createTextNode(source.getText()));
} else {
targetChild = owned.createElement(source.getName());
代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Copies <code>this</code> reference to the specified {@link Node}
* @param copyTarget
* @return
*/
private Node deepCopy(final Node copyTarget){
// Precondition checks
assert copyTarget != null : "Node to copy information into must be specified";
// Set attributes
final Map<String, String> attributes = this.getAttributes();
final Set<String> attributeKeys = attributes.keySet();
for (final String key : attributeKeys) {
final String value = attributes.get(key);
copyTarget.attribute(key, value);
}
// Set text
copyTarget.text(this.getText());
// Set children
final List<Node> children = this.getChildren();
for (final Node child : children) {
final Node newChild = copyTarget.createChild(child.getName());
// Recurse in
child.deepCopy(newChild);
}
// Return
return this;
}
代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-spi
/**
* Copies <code>this</code> reference to the specified {@link Node}
* @param copyTarget
* @return
*/
private Node deepCopy(final Node copyTarget){
// Precondition checks
assert copyTarget != null : "Node to copy information into must be specified";
// Set attributes
final Map<String, String> attributes = this.getAttributes();
final Set<String> attributeKeys = attributes.keySet();
for (final String key : attributeKeys) {
final String value = attributes.get(key);
copyTarget.attribute(key, value);
}
// Set text
copyTarget.text(this.getText());
// Set children
final List<Node> children = this.getChildren();
for (final Node child : children) {
final Node newChild = copyTarget.createChild(child.getName());
// Recurse in
child.deepCopy(newChild);
}
// Return
return this;
}
内容来源于网络,如有侵权,请联系作者删除!