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


Java NodeList.item方法代码示例

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


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

示例1: InitialItemData

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public InitialItemData(XmlData itemData) {

        NodeList outcomeDeclarationNodes = null;

        outcomes = new HashMap<String, Outcome>();

        if (itemData != null) {
            outcomeDeclarationNodes = itemData.getDocument().getElementsByTagName("outcomeDeclaration");

            Outcome currOutcome;
            for (int i = 0; i < outcomeDeclarationNodes.getLength(); i++) {
                currOutcome = new Outcome(outcomeDeclarationNodes.item(i));
                if (currOutcome != null) {
                    outcomes.put(currOutcome.identifier, currOutcome);
                }
            }
        }
    }
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:19,代码来源:InitialItemData.java

示例2: StyleLinkDeclaration

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public StyleLinkDeclaration(NodeList styleNodes, String pbaseUrl) {

        styles = new Vector<StyleLink>();
        baseUrl = pbaseUrl;

        if (styleNodes == null || styleNodes.getLength() == 0) {
            return;
        }

        NodeList styleLinkNodes = styleNodes.item(0).getChildNodes();

        if (styleLinkNodes != null) {
            for (int n = 0; n < styleLinkNodes.getLength(); n++) {
                Node styleLinkNode = styleLinkNodes.item(n);
                try {
                    StyleLink sd = new StyleLink(styleLinkNode.getAttributes().getNamedItem("href").getNodeValue(),
                            styleLinkNode.getAttributes().getNamedItem("userAgent").getNodeValue());
                    styles.add(sd);
                } catch (Exception e) {
                }
            }
        }

    }
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:25,代码来源:StyleLinkDeclaration.java

示例3: VariableManager

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public VariableManager(NodeList responseDeclarationNodes, IVariableCreator<V> variableCreator) {
    Node node;
    String currIdentifier;

    if (responseDeclarationNodes != null) {
        for (int i = 0; i < responseDeclarationNodes.getLength(); i++) {
            node = responseDeclarationNodes.item(i);
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                currIdentifier = node.getAttributes().getNamedItem("identifier").getNodeValue();
                V var = variableCreator.createVariable(node);
                if (var != null) {
                    variables.put(currIdentifier, var);
                }
            }
        }
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:18,代码来源:VariableManager.java

示例4: addVariable

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
/**
 * Adds a <link match=.../> element to the <args> section of the LASRequest.
 * This will add a new dataset-variable pair to the LASRequest. Note that
 * the order in which variables appear in an LASRequest is important as
 * differencing products (as of 2007-10-24) always subtract the second
 * variable from the first.
 * 
 * @param dsID
 * @param varID
 * @param region
 *            - the region to which this variable belongs.
 */
public void addVariable(String dsID, String varID, int region_index) {
    Element link = makeLink(dsID, varID);
    NodeList l = document.getDocumentElement().getElementsByTagName("args");
    Element args = (Element) l.item(0);
    if ( args == null ) {
        args = document.createElement("args");
        document.getDocumentElement().appendChild(args);
    }
    NodeList regions = document.getElementsByTagName("region");
    if ( region_index >= 0 && region_index < regions.getLength() ) {
        Element region = (Element) regions.item(region_index);
        args.insertBefore(link, region);
    } else {
        args.appendChild(link);
    }
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:29,代码来源:LASRequest.java

示例5: getVariable

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public String getVariable(int index) {
    Element args = getArgsElement();
    NodeList variables = args.getElementsByTagName("link");
    int counter = 0;
    for ( int i = 0; i < variables.getLength(); i++ ) {
        Element var = (Element) variables.item(i);
        // ByTagName gets children, grandchildren and below. Check that it
        // is a child of "args".
        if ( var.getParentNode().getNodeName().equals("args") ) {
            if ( counter == index ) {
                return getVariableId(var.getAttribute("match"));
            }
            counter++;
        }
    }
    return null;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:18,代码来源:LASRequest.java

示例6: getRangeHi

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public String getRangeHi(String axis_type, int index) {
    Element args = getArgsElement();
    NodeList regions = args.getElementsByTagName("region");
    if ( regions.getLength() > index ) {
        Element region = (Element) regions.item(index);
        NodeList ranges = region.getElementsByTagName("range");
        for ( int i = 0; i < ranges.getLength(); i++ ) {
            Element range = (Element) ranges.item(i);
            if ( range.getAttribute("type").equals(axis_type) ) {
                return range.getAttribute("high");
            }
        }
        NodeList points = region.getElementsByTagName("point");
        for ( int i = 0; i < points.getLength(); i++ ) {
            Element point = (Element) points.item(i);
            if ( point.getAttribute("type").equals(axis_type) ) {
                return point.getAttribute("v");
            }
        }
    }
    return null;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:LASRequest.java

示例7: getRangeLo

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public String getRangeLo(String axis_type, int index) {
    Element args = getArgsElement();
    NodeList regions = args.getElementsByTagName("region");
    if ( regions.getLength() > index ) {
        Element region = (Element) regions.item(index);
        NodeList ranges = region.getElementsByTagName("range");
        for ( int i = 0; i < ranges.getLength(); i++ ) {
            Element range = (Element) ranges.item(i);
            if ( range.getAttribute("type").equals(axis_type) ) {
                return range.getAttribute("low");
            }
        }
        NodeList points = region.getElementsByTagName("point");
        for ( int i = 0; i < points.getLength(); i++ ) {
            Element point = (Element) points.item(i);
            if ( point.getAttribute("type").equals(axis_type) ) {
                return point.getAttribute("v");
            }
        }
    }
    return null;
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:23,代码来源:LASRequest.java

示例8: getChildrenNS

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
@Override
public List<Element> getChildrenNS(String xmlns) throws XMLException {
	final ArrayList<Element> result = new ArrayList<Element>();
	NodeList nodes = this.xmlElement.getChildNodes();
	for (int i = 0; i < nodes.getLength(); i++) {
		Node node = nodes.item(i);
		if (node instanceof com.google.gwt.xml.client.Element) {
			final String x = ((com.google.gwt.xml.client.Element) node).getAttribute("xmlns");
			GwtElement gpi = new GwtElement((com.google.gwt.xml.client.Element) node);
			if (x != null && xmlns.equals(gpi.getXMLNS())) {
				result.add(gpi);
			}
		}
	}
	return result;
}
 
开发者ID:horsefaced,项目名称:jaxmpp-android,代码行数:17,代码来源:GwtElement.java

示例9: getFirstChild

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
@Override
public Element getFirstChild() throws XMLException {
	NodeList nodes = this.xmlElement.getChildNodes();
	for (int i = 0; i < nodes.getLength(); i++) {
		Node node = nodes.item(i);
		if (node instanceof com.google.gwt.xml.client.Element) {
			return new GwtElement((com.google.gwt.xml.client.Element) node);
		}
	}

	return null;
	// first child may not be Element it can be Node only!!
	// com.google.gwt.xml.client.Element c =
	// (com.google.gwt.xml.client.Element) xmlElement.getFirstChild();
	// return c == null ? null : new GwtElement(c);
}
 
开发者ID:horsefaced,项目名称:jaxmpp-android,代码行数:17,代码来源:GwtElement.java

示例10: treatValidRequests

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
/**
 * @param validRequest
 */
private static void treatValidRequests(Node validRequest) {    
  NodeList children = validRequest.getChildNodes();
  for(int i = 0; i < children.getLength(); i++) {
    Node node = children.item(i);
    if (node.getNodeType() != Node.ELEMENT_NODE) {
      continue;
    }
    if (node.getNodeName().equals("schemaLocation")) {        
      if (node.hasChildNodes() &&            
          !schemaLocations.contains(node.getFirstChild().getNodeValue())) {
        schemaLocations.add(node.getFirstChild().getNodeValue());          
      }    
    }
    else if (node.getNodeName().equals("defaultNamespace")) {        
      if (node.hasChildNodes() &&
          !defaultNamespace.contains(node.getFirstChild().getNodeValue())) {
        defaultNamespace.add(node.getFirstChild().getNodeValue());          
      }    
    }
  }    
}
 
开发者ID:tomayac,项目名称:rest-describe-and-compile,代码行数:25,代码来源:DiscoveredItemsDialog.java

示例11: buildNamedElements

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public static <E> ArrayList<E> buildNamedElements(Element e, String name, XMLNodeFactory<E> factory) {
	ArrayList<E> list = new ArrayList<E>();
	NodeList l = e.getChildNodes();
	for(int i = 0; i < l.getLength(); i++) {
		if(l.item(i) instanceof Element) {
			Element n = (Element)l.item(i);
			if(n.getNodeName().equals(name)) {
				E fn = factory.build(n);
				if(fn != null) {
					list.add(fn);
				}
			}
		}
	}
	return list;
}
 
开发者ID:pfranza,项目名称:gwtjaxb,代码行数:17,代码来源:XMLParsingUtils.java

示例12: parse

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
protected void parse(Node node) {
	parsed = true;
	NodeList childNodes = node.getChildNodes();
	for (int i = 0; i < childNodes.getLength(); i++) {
		Node child = childNodes.item(i);
		String nodeName = child.getNodeName();
		if ("Name".equalsIgnoreCase(nodeName)) {
			name = getValueRecursive(child);
		} else if ("Title".equalsIgnoreCase(nodeName)) {
			title = getValueRecursive(child);
		} else if ("Abstract".equalsIgnoreCase(nodeName)) {
			abstractt = getValueRecursive(child);
		} else if ("Keywords".equalsIgnoreCase(nodeName)) {
			addKeyWords(child);
		} else if ("SRS".equalsIgnoreCase(nodeName)) {
			defaultCrs = getValueRecursive(child);
		} else if ("LatLongBoundingBox".equalsIgnoreCase(nodeName)) {
			addLatLonBoundingBox(child);
		}
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:22,代码来源:WfsFeatureTypeInfo100.java

示例13: load

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public boolean load(Element coreElement, SolrCoreConfiguration configuration) {
    Properties properties = new Properties();
    configuration.setProperties(properties);

    Element element = getSingleChild(coreElement, "properties");
    if (element == null) {
        return true;
    }
    NodeList nodes = element.getChildNodes();
    for (int i=0; i<nodes.getLength(); i++) {
        Node node = nodes.item(i);
        if (node.getNodeType() != Node.ELEMENT_NODE) {
            continue;
        }
        Element propertyElement = (Element) node;
        if ("property".equals(propertyElement.getNodeName())) {
            String name = propertyElement.getAttribute("name");
            String value = DOMUtils.getTextValue(propertyElement);
            properties.put(name, value);
        }
    }
    return true;
}
 
开发者ID:cominvent,项目名称:solr-explorer,代码行数:24,代码来源:PropertiesConfigLoader.java

示例14: load

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
public boolean load(Element coreElement, SolrCoreConfiguration configuration) {
    Element sorting = getSingleChild(coreElement, "sorting");
    if (sorting == null) {
        return false;
    }

    SortConfig sortConfig = new SortConfig();
    String sortableFields = getSingleChildValue(sorting, "sortable-fields");
    String[] tokens = sortableFields.split(",");
    for (String token : tokens) {
        sortConfig.addSortableField(token.trim());
    }

    Element sortButtons = getSingleChild(sorting, "sort-buttons");
    NodeList sortButtonElements = sortButtons.getElementsByTagName("sort-button");
    for (int i=0; i<sortButtonElements.getLength(); i++) {
        Element sortButtonElement = (Element) sortButtonElements.item(i);
        String name = sortButtonElement.getAttribute("name");
        String fieldName = sortButtonElement.getAttribute("fieldName");
        sortConfig.addDefaultSortButton(name, fieldName);
    }

    configuration.setConfig(SortConfig.class, sortConfig);
    return true;
}
 
开发者ID:cominvent,项目名称:solr-explorer,代码行数:26,代码来源:SortConfigLoader.java

示例15: addTileSets

import com.google.gwt.xml.client.NodeList; //导入方法依赖的package包/类
private void addTileSets(Node tileSetsNode) {
	tileSets.clear();
	Element tileSetsEl = (Element) tileSetsNode;
	NodeList tileSetList = tileSetsEl.getElementsByTagName("TileSet");

	for (int i = 0; i < tileSetList.getLength(); i++) {
		Node tileSetNode = tileSetList.item(i);
		tileSets.add(new TileSetInfo100(tileSetNode));
	}
	if (tileSets.size() > 0) {
		TileSetInfo tileSet = tileSets.get(0);
		href = tileSet.getHref().substring(0, tileSet.getHref().lastIndexOf('/'));
	}

	NamedNodeMap attributes = tileSetsNode.getAttributes();
	profile = getValueRecursive(attributes.getNamedItem("profile"));
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:18,代码来源:TileMapInfo100.java


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