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


Java Node.getNodeValue方法代码示例

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


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

示例1: parseInsertColumn

import org.w3c.dom.Node; //导入方法依赖的package包/类
void parseInsertColumn(HashMap<Column, AbstractExpression> columns, Node columnNode, Database db, Table table) {
    NamedNodeMap attrs = columnNode.getAttributes();
    Node tableNameAttr = attrs.getNamedItem("table");
    Node columnNameAttr = attrs.getNamedItem("name");
    String tableName = tableNameAttr.getNodeValue();
    String columnName = columnNameAttr.getNodeValue();

    assert(tableName.equalsIgnoreCase(table.getTypeName()));
    Column column = table.getColumns().getIgnoreCase(columnName);

    AbstractExpression expr = null;
    NodeList children = columnNode.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
        Node node = children.item(i);
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            expr = parseExpressionTree(node, db);
            ExpressionUtil.assignLiteralConstantTypesRecursively(expr,
                    VoltType.get((byte)column.getType()));
            ExpressionUtil.assignOutputValueTypesRecursively(expr);
        }
    }

    columns.put(column, expr);
}
 
开发者ID:s-store,项目名称:s-store,代码行数:25,代码来源:ParsedInsertStmt.java

示例2: parseTransformation

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static void parseTransformation(SvgTree avg, Node nNode) {
    NamedNodeMap a = nNode.getAttributes();
    int len = a.getLength();

    for (int i = 0; i < len; i++) {
        Node n = a.item(i);
        String name = n.getNodeName();
        String value = n.getNodeValue();
        if (SVG_TRANSFORM.equals(name)) {
            if (value.startsWith("matrix(")) {
                value = value.substring("matrix(".length(), value.length() - 1);
                String[] sp = value.split(" ");
                for (int j = 0; j < sp.length; j++) {
                    avg.matrix[j] = Float.parseFloat(sp[j]);
                }
            }
        } else if (name.equals("y")) {
            Float.parseFloat(value);
        } else if (name.equals("x")) {
            Float.parseFloat(value);
        }

    }
}
 
开发者ID:RaysonYeungHK,项目名称:Svg2AndroidXml,代码行数:25,代码来源:Svg2Vector.java

示例3: getAttribute

import org.w3c.dom.Node; //导入方法依赖的package包/类
private String getAttribute(Node node, String attributeName)
		throws Exception {
	try {
		NamedNodeMap attributes = node.getAttributes();
		for (int i = 0; i < attributes.getLength(); i++) {
			Node attributeNode = attributes.item(i);
			if (attributeNode.getNodeName().equals(attributeName)) {
				return attributeNode.getNodeValue();
			}
		}
		return null;
	} catch (Exception e) {
		log.error(e);
		log.error(e.getStackTrace());
		throw (e);
	}
}
 
开发者ID:Esri,项目名称:defense-solutions-proofs-of-concept,代码行数:18,代码来源:CoTAdapterInbound.java

示例4: mergeStandardTextNode

import org.w3c.dom.Node; //导入方法依赖的package包/类
private void mergeStandardTextNode(Node node)
    throws IIOInvalidTreeException {
    // Convert to comments.  For the moment ignore the encoding issue.
    // Ignore keywords, language, and encoding (for the moment).
    // If compression tag is present, use only entries with "none".
    NodeList children = node.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
        Node child = children.item(i);
        NamedNodeMap attrs = child.getAttributes();
        Node comp = attrs.getNamedItem("compression");
        boolean copyIt = true;
        if (comp != null) {
            String compString = comp.getNodeValue();
            if (!compString.equals("none")) {
                copyIt = false;
            }
        }
        if (copyIt) {
            String value = attrs.getNamedItem("value").getNodeValue();
            COMMarkerSegment com = new COMMarkerSegment(value);
            insertCOMMarkerSegment(com);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:JPEGMetadata.java

示例5: getContent

import org.w3c.dom.Node; //导入方法依赖的package包/类
/**
 * Get the trimmed text content of a node or null if there is no text
 */
public static String getContent(Node n) {
	if (n == null)
		return null;
	Node n1 = DomUtil.getChild(n, Node.TEXT_NODE);

	if (n1 == null)
		return null;

	String s1 = n1.getNodeValue();
	return s1.trim();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:15,代码来源:DomUtil.java

示例6: addToScope

import org.w3c.dom.Node; //导入方法依赖的package包/类
@Override
protected void addToScope(Scriptable scope, NodeList nodeList) {
	if (nodeList != null) {
		String nodeValue = null;
		if (nodeList.getLength() > 0) {
			Node node = nodeList.item(0);
			nodeValue = node.getNodeValue();
			if (node instanceof Element)
				nodeValue = ((Element) node).getTextContent();
		}
		scope.put(getVariableName(), scope, nodeValue);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:14,代码来源:GetTextStatement.java

示例7: getTextContent

import org.w3c.dom.Node; //导入方法依赖的package包/类
protected static String getTextContent(Node node) {
    Node child = node.getFirstChild();
    if( null == child )
        return null;
    
    return child.getNodeValue();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:RSSFeed.java

示例8: parseMap

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static Request parseMap(Node root) {
	Request request = new Request();

	Node name = root.getAttributes().getNamedItem("name");
	request.name = name != null ? name.getNodeValue() : null;

	Node url = root.getAttributes().getNamedItem("url");
	request.url = url != null ? url.getNodeValue() : null;

	Node srs = root.getAttributes().getNamedItem("srs");
	request.srs = srs != null ? srs.getNodeValue() : null;

	Node wesn = root.getAttributes().getNamedItem("wesn");
	if (wesn != null) {
		String[] s = wesn.getNodeValue().split(",");

		request.wesn = new double[4];
		for (int i = 0; i < 4; i++)
			request.wesn[i] = Double.parseDouble(s[i]);
	}

	List<Node> layers = getElements(root, "wms_layer");
	Iterator<Node> iter = layers.iterator();
	request.layers = new RequestLayer[layers.size()];
	for (int i = 0; i < layers.size(); i++)
		request.layers[i] = parseLayer(iter.next());

	return request;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:30,代码来源:XML_Layer.java

示例9: _ProcessNode

import org.w3c.dom.Node; //导入方法依赖的package包/类
private static void _ProcessNode(Node n, int level) throws Exception {
    n.getAttributes();
    n.getChildNodes();

    // At this point, for JVM 1.6 and Xerces <= 1.3.1,
    // Test-XML.xml::mytest:Y's attribute is (already) bad.

    switch (n.getNodeType()) {

        case Node.TEXT_NODE:
            String str = n.getNodeValue().trim();

            /* ...Only print non-empty strings... */
            if (str.length() > 0) {
                String valStr = n.getNodeValue();

                _Println(valStr, level);
            }
            break;

        case Node.COMMENT_NODE:
            break;

        default: {
            String nodeNameStr = n.getNodeName();

            _Println(nodeNameStr + " (" + n.getClass() + "):", level);

            /* ...Print children... */
            _ProcessChildren(n, level);

            /* ...Print optional node attributes... */
            _PrintAttributes(n, level);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:Bug6760982.java

示例10: getBean

import org.w3c.dom.Node; //导入方法依赖的package包/类
public static Object getBean(String path, int i) {
    try {
        //创建文档对象
        DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = dFactory.newDocumentBuilder();
        Document doc;
        doc = builder.parse(new File(ToolDirFile.getClassesPath(XMLUtil.class) + path));

        //获取包含类名的文本节点
        NodeList nl = doc.getElementsByTagName("className");
        Node classNode;
        if (0 == i) {
            classNode = nl.item(0).getFirstChild();
        }
        else {
            classNode = nl.item(1).getFirstChild();
        }

        String cName = classNode.getNodeValue();

        //通过类名生成实例对象并将其返回
        Class c = Class.forName(cName);
        Object obj = c.newInstance();
        return obj;
    }
    catch(Exception e){
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:nellochen,项目名称:springboot-start,代码行数:31,代码来源:XMLUtil.java

示例11: VersionInfo

import org.w3c.dom.Node; //导入方法依赖的package包/类
public VersionInfo(Element element) {
	logger.debug("Constructor - entry");

	NodeList nodeList = element.getChildNodes();
	for (int n = 0; n < nodeList.getLength(); n++) {
		Node node = nodeList.item(n);
		if (node.getNodeType() == Node.ELEMENT_NODE) {
			Element childElement = (Element) node;

			if ("VERSION".equals(childElement.getNodeName())) {
				String name = childElement.getAttribute("NAME");
				String revision = childElement.getAttribute("REVISION");
				if ("Compatible index structure version".equals(name)) {
					setIndexStructure(revision);
				} else if ("SES API version".equals(name)) {
					setApi(revision);
				} else if ("SES build".equals(name)) {
					setBuild(revision);
				} else {
					logger.trace("Unexpected version information: " + name + " (" + revision + ")");
				}
			} else {
				logger.trace("Unrecognized child node: '" + childElement.getNodeName() + "'");
			}
		} else if ((node.getNodeType() == Node.TEXT_NODE) && (node.getNodeValue() != null) && (node.getNodeValue().trim().length() > 0)) {
			logger.trace("Unexpected text node (" + this.getClass().getName() + "): '" + node.getNodeValue() + "'");
		}
	}
	NamedNodeMap namedNodeMap = element.getAttributes();
	if (namedNodeMap != null) {
		for (int a = 0; a < namedNodeMap.getLength(); a++) {
			Attr attributeNode = (Attr) namedNodeMap.item(a);
			logger.trace("Unrecognized attribute: '" + attributeNode.getName() + "'");
		}
	}

	logger.debug("Constructor - exit");
}
 
开发者ID:Smartlogic-Semaphore-Limited,项目名称:Java-APIs,代码行数:39,代码来源:VersionInfo.java

示例12: getAttribute

import org.w3c.dom.Node; //导入方法依赖的package包/类
protected static String getAttribute(Node node, String name,
                                     String defaultValue, boolean required)
  throws IIOInvalidTreeException {
    Node attr = node.getAttributes().getNamedItem(name);
    if (attr == null) {
        if (!required) {
            return defaultValue;
        } else {
            fatal(node, "Required attribute " + name + " not present!");
        }
    }
    return attr.getNodeValue();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:GIFMetadata.java

示例13: process

import org.w3c.dom.Node; //导入方法依赖的package包/类
@Override
public void process(HyperlinkEnv env) {
    String className = env.getValueString();
    Node n = env.getDocumentContext().getDocRoot().getNode().getAttributes().
            getNamedItem(HibernateMappingXmlConstants.PACKAGE_ATTRIB);//NOI18N
    String pack = n == null ? null : n.getNodeValue();
    if(pack!=null &&  pack.length()>0){
        if(!className.contains(".")){
            className = pack + "." +className;
        }
    }
    HibernateEditorUtil.findAndOpenJavaClass(className, env.getDocument());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:JavaClassHyperlinkProcessor.java

示例14: getContent

import org.w3c.dom.Node; //导入方法依赖的package包/类
/** Get the trimed text content of a node or null if there is no text
 */
public static String getContent(Node n ) {
    if( n==null ) return null;
    Node n1=DomUtil.getChild(n, Node.TEXT_NODE);

    if( n1==null ) return null;

    String s1=n1.getNodeValue();
    return s1.trim();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:DomUtil.java

示例15: parseSignsNode

import org.w3c.dom.Node; //导入方法依赖的package包/类
/** Analiza el nodo con el listado de firmas.
 * @param signsNode Nodo con el listado de firmas.
 * @return Listado con la informaci&oacute;n de cada operaci&oacute;n de firma. */
private static List<TriSign> parseSignsNode(final Node signsNode) {

	final NodeList childNodes = signsNode.getChildNodes();

	final List<TriSign> signs = new ArrayList<TriSign>();
	int idx = nextNodeElementIndex(childNodes, 0);
	while (idx != -1) {
		final Node currentNode = childNodes.item(idx);

		String id = null;

		final NamedNodeMap nnm = currentNode.getAttributes();
		if (nnm != null) {
			final Node tmpNode = nnm.getNamedItem("Id"); //$NON-NLS-1$
			if (tmpNode != null) {
				id = tmpNode.getNodeValue();
			}
		}
		signs.add(
			new TriSign(
				parseParamsListNode(currentNode),
				id
			)
		);
		idx = nextNodeElementIndex(childNodes, idx + 1);
	}

	return signs;
}
 
开发者ID:MiFirma,项目名称:mi-firma-android,代码行数:33,代码来源:TriphaseData.java


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