org.dom4j.Node.getName()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(149)

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

Node.getName介绍

[英]getName returns the name of this node. This is the XML local name of the element, attribute, entity or processing instruction. For CDATA and Text nodes this method will return null.
[中]getName返回此节点的名称。这是元素、属性、实体或处理指令的XML本地名称。对于CDATA和文本节点,此方法将返回null。

代码示例

代码示例来源:origin: org.freemarker/freemarker

@Override
String getLocalName(Object node) {
  return ((Node) node).getName();
}

代码示例来源:origin: pentaho/pentaho-kettle

private void addLoopXPath( Node node, IProgressMonitor monitor ) {
 Element ce = (Element) node;
 monitor.worked( 1 );
 // List child
 for ( int j = 0; j < ce.nodeCount(); j++ ) {
  if ( monitor.isCanceled() ) {
   return;
  }
  Node cnode = ce.node( j );
  if ( !Utils.isEmpty( cnode.getName() ) ) {
   Element cce = (Element) cnode;
   if ( !listpath.contains( cnode.getPath() ) ) {
    nr++;
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.FetchNodes",
      String.valueOf( nr ) ) );
    monitor.subTask( BaseMessages.getString( PKG, "GetXMLDateLoopNodesImportProgressDialog.Task.AddingNode",
      cnode.getPath() ) );
    listpath.add( cnode.getPath() );
   }
   // let's get child nodes
   if ( cce.nodeCount() > 1 ) {
    addLoopXPath( cnode, monitor );
   }
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean childNode( Node node, IProgressMonitor monitor ) {
 boolean rc = false; // true: we found child nodes
 Element ce = (Element) node;
 // List child
 for ( int j = 0; j < ce.nodeCount(); j++ ) {
  Node cnode = ce.node( j );
  if ( !Utils.isEmpty( cnode.getName() ) ) {
   Element cce = (Element) cnode;
   if ( cce.nodeCount() > 1 ) {
    if ( childNode( cnode, monitor ) == false ) {
     // We do not have child nodes ...
     setNodeField( cnode, monitor );
     rc = true;
    }
   } else {
    setNodeField( cnode, monitor );
    rc = true;
   }
  }
 }
 return rc;
}

代码示例来源:origin: org.dom4j/dom4j

public String toString() {
  return xmlNode.getName();
}

代码示例来源:origin: pentaho/pentaho-kettle

String nodename = node.getName();
String nodenametxt = cleanString( node.getPath() );

代码示例来源:origin: org.dom4j/dom4j

String name = node.getName();
RuleSet ruleSet = (RuleSet) elementNameRuleSets.get(name);
String name = node.getName();
RuleSet ruleSet = (RuleSet) attributeNameRuleSets.get(name);

代码示例来源:origin: org.compass-project/compass

/**
 * Returns the dom4j node name.
 */
public String getName() {
  return node.getName();
}

代码示例来源:origin: dom4j/dom4j

public String toString() {
  return xmlNode.getName();
}

代码示例来源:origin: org.freemarker/freemarker-gae

@Override
String getLocalName(Object node) {
  return ((Node) node).getName();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker

@Override
String getLocalName(Object node) {
  return ((Node) node).getName();
}

代码示例来源:origin: org.hudsonci.xpath/xpath-service

Name(Node n) {
 qualifiedName = n.getName();
}
Name(Element el) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

public String toString() {
  return xmlNode.getName();
}

代码示例来源:origin: com.github.binarywang/weixin-java-common

private static Set<String> names(List<Node> nodes) {
  Set<String> names = Sets.newHashSet();
  for (Node node : nodes) {
   if (node instanceof DefaultText) {
    continue;
   }
   names.add(node.getName());
  }

  return names;
 }
}

代码示例来源:origin: binarywang/WxJava

private static Set<String> names(List<Node> nodes) {
  Set<String> names = Sets.newHashSet();
  for (Node node : nodes) {
   if (node instanceof DefaultText) {
    continue;
   }
   names.add(node.getName());
  }

  return names;
 }
}

代码示例来源:origin: USPTO/PatentPublicData

@Override
public PatentClassification read() {
  if ("classification-ipcr".equals(itemNode.getName())) {
    return readSectionedFormat();
  } else if ("classification-ipc".equals(itemNode.getName())) {
    return readFlatFormat();
  }
  return null;
}

代码示例来源:origin: USPTO/PatentPublicData

private Name parseName(Node fullNameNode) {
    try {
      return nameParser.createName(fullNameNode.getText());
    } catch (InvalidDataException e) {
      LOGGER.warn("Failed to Parse Name from: {}", fullNameNode.getName(), e);
    }
    return null;
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

protected static void replaceNode(Node container, Element value) {
  if ( container!=value ) { //not really necessary, I guess...
    Element parent = container.getParent();
    container.detach();
    value.setName( container.getName() );
    value.detach();
    parent.add(value);
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

protected static void replaceNode(Node container, Element value) {
  if ( container!=value ) { //not really necessary, I guess...
    Element parent = container.getParent();
    container.detach();
    value.setName( container.getName() );
    value.detach();
    parent.add(value);
  }
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

protected static void replaceNode(Node container, Element value) {
  if ( container!=value ) { //not really necessary, I guess...
    Element parent = container.getParent();
    container.detach();
    value.setName( container.getName() );
    value.detach();
    parent.add(value);
  }
}

代码示例来源:origin: hibernate/hibernate

protected static void replaceNode(Node container, Element value) {
  if ( container!=value ) { //not really necessary, I guess...
    Element parent = container.getParent();
    container.detach();
    value.setName( container.getName() );
    value.detach();
    parent.add(value);
  }
}

相关文章