Example usage for org.w3c.dom Node DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

List of usage examples for org.w3c.dom Node DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

Introduction

In this page you can find the example usage for org.w3c.dom Node DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC.

Prototype

short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC

To view the source code for org.w3c.dom Node DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC.

Click Source Link

Document

The determination of preceding versus following is implementation-specific.

Usage

From source file:Main.java

/**
 * Convert a node type to a string. For debug purpose only.
 * //from w  w  w.j  a v  a2s  . c om
 * @param nodeType
 *            the node type
 * @return the string
 * @throws Exception
 *             the exception
 */
public static String nodeTypeToString(short nodeType) throws Exception {
    if (nodeType == Node.ELEMENT_NODE)
        return "ELEMENT_NODE";
    if (nodeType == Node.ATTRIBUTE_NODE)
        return "ATTRIBUTE_NODE";
    if (nodeType == Node.TEXT_NODE)
        return "TEXT_NODE";
    if (nodeType == Node.CDATA_SECTION_NODE)
        return "CDATA_SECTION_NODE";
    if (nodeType == Node.ENTITY_REFERENCE_NODE)
        return "ENTITY_REFERENCE_NODE";
    if (nodeType == Node.ENTITY_NODE)
        return "ENTITY_NODE";
    if (nodeType == Node.PROCESSING_INSTRUCTION_NODE)
        return "PROCESSING_INSTRUCTION_NODE";
    if (nodeType == Node.COMMENT_NODE)
        return "COMMENT_NODE";
    if (nodeType == Node.DOCUMENT_NODE)
        return "DOCUMENT_NODE";
    if (nodeType == Node.DOCUMENT_TYPE_NODE)
        return "DOCUMENT_TYPE_NODE";
    if (nodeType == Node.DOCUMENT_FRAGMENT_NODE)
        return "DOCUMENT_FRAGMENT_NODE";
    if (nodeType == Node.NOTATION_NODE)
        return "NOTATION_NODE";
    if (nodeType == Node.DOCUMENT_POSITION_DISCONNECTED)
        return "DOCUMENT_POSITION_DISCONNECTED";
    if (nodeType == Node.DOCUMENT_POSITION_PRECEDING)
        return "DOCUMENT_POSITION_PRECEDING";
    if (nodeType == Node.DOCUMENT_POSITION_FOLLOWING)
        return "DOCUMENT_POSITION_FOLLOWING";
    if (nodeType == Node.DOCUMENT_POSITION_CONTAINS)
        return "DOCUMENT_POSITION_CONTAINS";
    if (nodeType == Node.DOCUMENT_POSITION_CONTAINED_BY)
        return "DOCUMENT_POSITION_CONTAINED_BY";
    if (nodeType == Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)
        return "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC";

    throw new Exception("Unknown value : " + nodeType);
}