当前位置: 首页>>代码示例>>Java>>正文


Java Node.getChildNodes方法代码示例

本文整理汇总了Java中org.w3c.dom.Node.getChildNodes方法的典型用法代码示例。如果您正苦于以下问题:Java Node.getChildNodes方法的具体用法?Java Node.getChildNodes怎么用?Java Node.getChildNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.w3c.dom.Node的用法示例。


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

示例1: parseConnectionFactory

import org.w3c.dom.Node; //导入方法依赖的package包/类
protected void parseConnectionFactory(Context context, Node node) {
    ConnectionFactoryConfiguration connectionFactoryConfiguration = new ConnectionFactoryConfiguration();

    context.setConnectionFactoryConfiguration(connectionFactoryConfiguration);

    Properties attributes = parseAttributes(node);
    String type = attributes.getProperty("type"); //$NON-NLS-1$

    if (stringHasValue(type)) {
        connectionFactoryConfiguration.setConfigurationType(type);
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(connectionFactoryConfiguration, childNode);
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:26,代码来源:MyBatisGeneratorConfigurationParser.java

示例2: toString

import org.w3c.dom.Node; //导入方法依赖的package包/类
/**
 * Return the string value of a Node
 *
 * @param n The Node.
 * @return The string value of the Node
 */
protected static String toString(Node n)
{
  if (n instanceof DTMNodeProxy)
       return ((DTMNodeProxy)n).getStringValue();
  else
  {
    String value = n.getNodeValue();
    if (value == null)
    {
      NodeList nodelist = n.getChildNodes();
      StringBuffer buf = new StringBuffer();
      for (int i = 0; i < nodelist.getLength(); i++)
      {
        Node childNode = nodelist.item(i);
        buf.append(toString(childNode));
      }
      return buf.toString();
    }
    else
      return value;
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:ExsltBase.java

示例3: newKeySelector

import org.w3c.dom.Node; //导入方法依赖的package包/类
public KeySelector newKeySelector(Node nodeSignature)
        throws DigitalSignatureValidationException {

    Node nodeKeyinfo = getKeyInfoNode(nodeSignature);
    if (nodeKeyinfo == null) {
        throw new DigitalSignatureValidationException(
                "No KeyInfo element found in SAML assertion");
    }

    NodeList children = nodeKeyinfo.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
        Node node = children.item(i);
        if (SamlXmlTags.NODE_KEY_VALUE.equals(node.getLocalName())) {
            return new KeyValueKeySelector();
        } else if (SamlXmlTags.NODE_X509DATA.equals(node.getLocalName())) {
            return new X509KeySelector(keystore);
        }
    }

    throw new DigitalSignatureValidationException(
            "Only RSA/DSA KeyValue and are X509Data supported");
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:23,代码来源:KeySelectorFactory.java

示例4: variableNotUsed

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static boolean variableNotUsed(Node root, Node variable)
{
	if (root.getNodeName().equals("value"))
	{
		if (root.isEqualNode(variable))
			return false;
		else
			return true;
	}

	NodeList statements = root.getChildNodes();
	for (int i = 0; i < statements.getLength(); i++)
	{
		Node statement = statements.item(i);
		if (!statement.getNodeName().equals("uses"))
		    if (!variableNotUsed(statement,variable))
		    {
		    	return false;
		    }
	}
	return true;
}
 
开发者ID:Christopher-Chianelli,项目名称:ccpa,代码行数:23,代码来源:TreeOptimizer.java

示例5: parseIbatorPlugin

import org.w3c.dom.Node; //导入方法依赖的package包/类
private void parseIbatorPlugin(Context context, Node node) {
    PluginConfiguration pluginConfiguration = new PluginConfiguration();

    context.addPluginConfiguration(pluginConfiguration);

    Properties attributes = parseAttributes(node);
    String type = attributes.getProperty("type"); //$NON-NLS-1$

    pluginConfiguration.setConfigurationType(type);

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(pluginConfiguration, childNode);
        }
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:24,代码来源:IbatorConfigurationParser.java

示例6: parseCommentGenerator

import org.w3c.dom.Node; //导入方法依赖的package包/类
protected void parseCommentGenerator(Context context, Node node) {
    CommentGeneratorConfiguration commentGeneratorConfiguration = new CommentGeneratorConfiguration();

    context.setCommentGeneratorConfiguration(commentGeneratorConfiguration);

    Properties attributes = parseAttributes(node);
    String type = attributes.getProperty("type"); //$NON-NLS-1$

    if (stringHasValue(type)) {
        commentGeneratorConfiguration.setConfigurationType(type);
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(commentGeneratorConfiguration, childNode);
        }
    }
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:26,代码来源:MyBatisGeneratorConfigurationParser.java

示例7: parseJavaTypeResolver

import org.w3c.dom.Node; //导入方法依赖的package包/类
protected void parseJavaTypeResolver(Context context, Node node) {
    JavaTypeResolverConfiguration javaTypeResolverConfiguration = new JavaTypeResolverConfiguration();

    context.setJavaTypeResolverConfiguration(javaTypeResolverConfiguration);

    Properties attributes = parseAttributes(node);
    String type = attributes.getProperty("type"); //$NON-NLS-1$

    if (stringHasValue(type)) {
        javaTypeResolverConfiguration.setConfigurationType(type);
    }

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(javaTypeResolverConfiguration, childNode);
        }
    }
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:26,代码来源:MyBatisGeneratorConfigurationParser.java

示例8: addTextNodesToRemoveAndTrim

import org.w3c.dom.Node; //导入方法依赖的package包/类
private void addTextNodesToRemoveAndTrim(List<Node> toRemove, Node node) {
    if (node instanceof Text) {
        Text text = (Text)node;
        boolean BUG_369394_IS_VALID = false;
        if (!BUG_369394_IS_VALID) {
            text.setData(text.getData().trim());
        } else {
            if (text.getData().trim().length() == 0) {
                text.setData("");
            }
        }
        if (text.getData().length() == 0) {
            toRemove.add(node);
        }
    }
    if (node.getChildNodes() != null) {
        for (int i=0; i<node.getChildNodes().getLength(); i++) {
            addTextNodesToRemoveAndTrim(toRemove, node.getChildNodes().item(i));
        }
    }
}
 
开发者ID:middle2tw,项目名称:whackpad,代码行数:22,代码来源:XmlProcessor.java

示例9: setFromMarkerSequenceNode

import org.w3c.dom.Node; //导入方法依赖的package包/类
void setFromMarkerSequenceNode(Node markerSequenceNode)
    throws IIOInvalidTreeException{

    NodeList children = markerSequenceNode.getChildNodes();
    // for all the children, add a marker segment
    for (int i = 0; i < children.getLength(); i++) {
        Node node = children.item(i);
        String childName = node.getNodeName();
        if (childName.equals("dqt")) {
            markerSequence.add(new DQTMarkerSegment(node));
        } else if (childName.equals("dht")) {
            markerSequence.add(new DHTMarkerSegment(node));
        } else if (childName.equals("dri")) {
            markerSequence.add(new DRIMarkerSegment(node));
        } else if (childName.equals("com")) {
            markerSequence.add(new COMMarkerSegment(node));
        } else if (childName.equals("app14Adobe")) {
            markerSequence.add(new AdobeMarkerSegment(node));
        } else if (childName.equals("unknown")) {
            markerSequence.add(new MarkerSegment(node));
        } else if (childName.equals("sof")) {
            markerSequence.add(new SOFMarkerSegment(node));
        } else if (childName.equals("sos")) {
            markerSequence.add(new SOSMarkerSegment(node));
        } else {
            throw new IIOInvalidTreeException("Invalid "
                + (isStream ? "stream " : "image ") + "child: "
                + childName, node);
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:JPEGMetadata.java

示例10: getElements

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static List<Node> getElements(Node node, String elementName) {
	List<Node> list = new LinkedList<Node>();
	NodeList nodeList = node.getChildNodes();
	for (int i = 0; i < nodeList.getLength(); i++) {
		if (nodeList.item(i).getNodeName().equals(elementName)
				&& nodeList.item(i).getNodeType() == Node.ELEMENT_NODE) {
			list.add(nodeList.item(i));
		}	
	}
	return list;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:PathUtil.java

示例11: getText

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static String getText(Node node) {
	NodeList nodeList = node.getChildNodes();
	for (int i = 0; i < nodeList.getLength(); i++) {
		if (nodeList.item(i).getNodeName().equals("#text") ||
				nodeList.item(i).getNodeName().equals("#cdata-section"))
		{
			return nodeList.item(i).getNodeValue();
		}
	}
	return null;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:12,代码来源:ParseBRG.java

示例12: getElementsByTagName

import org.w3c.dom.Node; //导入方法依赖的package包/类
/**
 *
 * @param tagname
 *
 *
 * @see org.w3c.dom.Document
 */
@Override
public final NodeList getElementsByTagName(String tagname)
{
     Vector listVector = new Vector();
     Node retNode = dtm.getNode(node);
     if (retNode != null)
     {
       boolean isTagNameWildCard = "*".equals(tagname);
       if (DTM.ELEMENT_NODE == retNode.getNodeType())
       {
         NodeList nodeList = retNode.getChildNodes();
         for (int i = 0; i < nodeList.getLength(); i++)
         {
           traverseChildren(listVector, nodeList.item(i), tagname,
                            isTagNameWildCard);
         }
       } else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
         traverseChildren(listVector, dtm.getNode(node), tagname,
                          isTagNameWildCard);
       }
     }
     int size = listVector.size();
     NodeSet nodeSet = new NodeSet(size);
     for (int i = 0; i < size; i++)
     {
       nodeSet.addNode((Node) listVector.elementAt(i));
     }
     return (NodeList) nodeSet;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:DTMNodeProxy.java

示例13: getLastChildNode

import org.w3c.dom.Node; //导入方法依赖的package包/类
/**
 * Returns the last child node with the provided name if existing.
 * 
 * @param parentNode
 *            the node to find the wanted child in
 * @param nodeName
 *            the wanted child node name
 * @return the matching child node or <code>null</code> if not found
 */
public static Node getLastChildNode(Node parentNode, String nodeName) {
    NodeList childNodes = parentNode.getChildNodes();
    Node node = null;
    for (int index = 0; index < childNodes.getLength(); index++) {
        if (nodeName.equals(childNodes.item(index).getNodeName())) {
            node = childNodes.item(index);
        }
    }
    return node;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:XMLConverter.java

示例14: getElement

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static Node getElement(Node node, String elementName) {
	NodeList nodeList = node.getChildNodes();
	for (int i = 0; i < nodeList.getLength(); i++) {
		if (nodeList.item(i).getNodeName().equals(elementName)
				&& nodeList.item(i).getNodeType() == Node.ELEMENT_NODE)
			return nodeList.item(i);
	}
	return null;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:10,代码来源:XML_Layer.java

示例15: parseSqlMapGenerator

import org.w3c.dom.Node; //导入方法依赖的package包/类
private void parseSqlMapGenerator(AbatorContext abatorContext, Node node) {
    SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration = new SqlMapGeneratorConfiguration();

    abatorContext
            .setSqlMapGeneratorConfiguration(sqlMapGeneratorConfiguration);

    Properties attributes = parseAttributes(node);
    String type = attributes.getProperty("type"); //$NON-NLS-1$
    String targetPackage = attributes.getProperty("targetPackage"); //$NON-NLS-1$
    String targetProject = attributes.getProperty("targetProject"); //$NON-NLS-1$

    if (StringUtility.stringHasValue(type)) {
        sqlMapGeneratorConfiguration.setConfigurationType(type);
    }

    sqlMapGeneratorConfiguration.setTargetPackage(targetPackage);
    sqlMapGeneratorConfiguration.setTargetProject(targetProject);

    NodeList nodeList = node.getChildNodes();
    for (int i = 0; i < nodeList.getLength(); i++) {
        Node childNode = nodeList.item(i);

        if (childNode.getNodeType() != 1) {
            continue;
        }

        if ("property".equals(childNode.getNodeName())) { //$NON-NLS-1$
            parseProperty(sqlMapGeneratorConfiguration, childNode);
        }
    }
}
 
开发者ID:ajtdnyy,项目名称:PackagePlugin,代码行数:32,代码来源:AbatorConfigurationParser.java


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