當前位置: 首頁>>代碼示例>>Java>>正文


Java DOMException.getMessage方法代碼示例

本文整理匯總了Java中org.w3c.dom.DOMException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java DOMException.getMessage方法的具體用法?Java DOMException.getMessage怎麽用?Java DOMException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.w3c.dom.DOMException的用法示例。


在下文中一共展示了DOMException.getMessage方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: endElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Checks whether control needs to be returned to Digester.
 * 
 * @param namespaceURI the namespace URI
 * @param localName the local name
 * @param qName the qualified (prefixed) name
 * @throws SAXException if the DOM implementation throws an exception
 */
@Override
public void endElement(String namespaceURI, String localName,
                       String qName)
    throws SAXException {
    
    try {
        if (depth == 0) {
            getDigester().getXMLReader().setContentHandler(
                oldContentHandler);
            getDigester().push(root);
            getDigester().endElement(namespaceURI, localName, qName);
        }
    
        top = top.getParentNode();
        depth--;
    } catch (DOMException e) {
        throw new SAXException(e.getMessage(), e);
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:29,代碼來源:NodeCreateRule.java

示例2: endElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Checks whether control needs to be returned to Digester.
 * 
 * @param namespaceURI the namespace URI
 * @param localName the local name
 * @param qName the qualified (prefixed) name
 * @throws SAXException if the DOM implementation throws an exception
 */
public void endElement(String namespaceURI, String localName,
                       String qName)
    throws SAXException {
    
    try {
        if (depth == 0) {
            getDigester().getXMLReader().setContentHandler(
                oldContentHandler);
            getDigester().push(root);
            getDigester().endElement(namespaceURI, localName, qName);
        }
    
        top = top.getParentNode();
        depth--;
    } catch (DOMException e) {
        throw new SAXException(e.getMessage());
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:28,代碼來源:NodeCreateRule.java

示例3: endElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Checks whether control needs to be returned to Digester.
 * 
 * @param namespaceURI
 *            the namespace URI
 * @param localName
 *            the local name
 * @param qName
 *            the qualified (prefixed) name
 * @throws SAXException
 *             if the DOM implementation throws an exception
 */
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {

	try {
		if (depth == 0) {
			getDigester().getXMLReader().setContentHandler(oldContentHandler);
			getDigester().push(root);
			getDigester().endElement(namespaceURI, localName, qName);
		}

		top = top.getParentNode();
		depth--;
	} catch (DOMException e) {
		throw new SAXException(e.getMessage(), e);
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:30,代碼來源:NodeCreateRule.java

示例4: characters

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Appends a {@link org.w3c.dom.Text Text} node to the current node.
 * 
 * @param ch the characters from the XML document
 * @param start the start position in the array
 * @param length the number of characters to read from the array
 * @throws SAXException if the DOM implementation throws an exception
 */
@Override
public void characters(char[] ch, int start, int length)
    throws SAXException {

    try {
        String str = new String(ch, start, length);
        if (str.trim().length() > 0) { 
            top.appendChild(doc.createTextNode(str));
        }
    } catch (DOMException e) {
        throw new SAXException(e.getMessage(), e);
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:23,代碼來源:NodeCreateRule.java

示例5: processingInstruction

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new
 * {@link org.w3c.dom.ProcessingInstruction ProcessingInstruction} to 
 * the current node.
 * 
 * @param target the processing instruction target
 * @param data the processing instruction data, or null if none was 
 *   supplied
 * @throws SAXException if the DOM implementation throws an exception
 */
@Override
public void processingInstruction(String target, String data)
    throws SAXException {
    
    try {
        top.appendChild(doc.createProcessingInstruction(target, data));
    } catch (DOMException e) {
        throw new SAXException(e.getMessage(), e);
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:22,代碼來源:NodeCreateRule.java

示例6: startElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new child {@link org.w3c.dom.Element Element} to the current
 * node.
 * 
 * @param namespaceURI the namespace URI
 * @param localName the local name
 * @param qName the qualified (prefixed) name
 * @param atts the list of attributes
 * @throws SAXException if the DOM implementation throws an exception
 */
@Override
public void startElement(String namespaceURI, String localName,
                         String qName, Attributes atts)
    throws SAXException {

    try {
        Node previousTop = top;
        if ((localName == null) || (localName.length() == 0)) { 
            top = doc.createElement(qName);
        } else {
            top = doc.createElementNS(namespaceURI, localName);
        }
        for (int i = 0; i < atts.getLength(); i++) {
            Attr attr = null;
            if ((atts.getLocalName(i) == null) ||
                (atts.getLocalName(i).length() == 0)) {
                attr = doc.createAttribute(atts.getQName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element)top).setAttributeNode(attr);
            } else {
                attr = doc.createAttributeNS(atts.getURI(i),
                                             atts.getLocalName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element)top).setAttributeNodeNS(attr);
            }
        }
        previousTop.appendChild(top);
        depth++;
    } catch (DOMException e) {
        throw new SAXException(e.getMessage(), e);
    }

}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:44,代碼來源:NodeCreateRule.java

示例7: characters

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Appends a {@link org.w3c.dom.Text Text} node to the current node.
 * 
 * @param ch the characters from the XML document
 * @param start the start position in the array
 * @param length the number of characters to read from the array
 * @throws SAXException if the DOM implementation throws an exception
 */
public void characters(char[] ch, int start, int length)
    throws SAXException {

    try {
        String str = new String(ch, start, length);
        if (str.trim().length() > 0) { 
            top.appendChild(doc.createTextNode(str));
        }
    } catch (DOMException e) {
        throw new SAXException(e.getMessage());
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:NodeCreateRule.java

示例8: processingInstruction

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new
 * {@link org.w3c.dom.ProcessingInstruction ProcessingInstruction} to 
 * the current node.
 * 
 * @param target the processing instruction target
 * @param data the processing instruction data, or null if none was 
 *   supplied
 * @throws SAXException if the DOM implementation throws an exception
 */
public void processingInstruction(String target, String data)
    throws SAXException {
    
    try {
        top.appendChild(doc.createProcessingInstruction(target, data));
    } catch (DOMException e) {
        throw new SAXException(e.getMessage());
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:21,代碼來源:NodeCreateRule.java

示例9: startElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new child {@link org.w3c.dom.Element Element} to the current
 * node.
 * 
 * @param namespaceURI the namespace URI
 * @param localName the local name
 * @param qName the qualified (prefixed) name
 * @param atts the list of attributes
 * @throws SAXException if the DOM implementation throws an exception
 */
public void startElement(String namespaceURI, String localName,
                         String qName, Attributes atts)
    throws SAXException {

    try {
        Node previousTop = top;
        if ((localName == null) || (localName.length() == 0)) { 
            top = doc.createElement(qName);
        } else {
            top = doc.createElementNS(namespaceURI, localName);
        }
        for (int i = 0; i < atts.getLength(); i++) {
            Attr attr = null;
            if ((atts.getLocalName(i) == null) ||
                (atts.getLocalName(i).length() == 0)) {
                attr = doc.createAttribute(atts.getQName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element)top).setAttributeNode(attr);
            } else {
                attr = doc.createAttributeNS(atts.getURI(i),
                                             atts.getLocalName(i));
                attr.setNodeValue(atts.getValue(i));
                ((Element)top).setAttributeNodeNS(attr);
            }
        }
        previousTop.appendChild(top);
        depth++;
    } catch (DOMException e) {
        throw new SAXException(e.getMessage());
    }

}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:43,代碼來源:NodeCreateRule.java

示例10: characters

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Appends a {@link org.w3c.dom.Text Text} node to the current node.
 * 
 * @param ch
 *            the characters from the XML document
 * @param start
 *            the start position in the array
 * @param length
 *            the number of characters to read from the array
 * @throws SAXException
 *             if the DOM implementation throws an exception
 */
@Override
public void characters(char[] ch, int start, int length) throws SAXException {

	try {
		String str = new String(ch, start, length);
		if (str.trim().length() > 0) {
			top.appendChild(doc.createTextNode(str));
		}
	} catch (DOMException e) {
		throw new SAXException(e.getMessage(), e);
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:26,代碼來源:NodeCreateRule.java

示例11: startElement

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new child {@link org.w3c.dom.Element Element} to the current
 * node.
 * 
 * @param namespaceURI
 *            the namespace URI
 * @param localName
 *            the local name
 * @param qName
 *            the qualified (prefixed) name
 * @param atts
 *            the list of attributes
 * @throws SAXException
 *             if the DOM implementation throws an exception
 */
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
		throws SAXException {

	try {
		Node previousTop = top;
		if ((localName == null) || (localName.length() == 0)) {
			top = doc.createElement(qName);
		} else {
			top = doc.createElementNS(namespaceURI, localName);
		}
		for (int i = 0; i < atts.getLength(); i++) {
			Attr attr = null;
			if ((atts.getLocalName(i) == null) || (atts.getLocalName(i).length() == 0)) {
				attr = doc.createAttribute(atts.getQName(i));
				attr.setNodeValue(atts.getValue(i));
				((Element) top).setAttributeNode(attr);
			} else {
				attr = doc.createAttributeNS(atts.getURI(i), atts.getLocalName(i));
				attr.setNodeValue(atts.getValue(i));
				((Element) top).setAttributeNodeNS(attr);
			}
		}
		previousTop.appendChild(top);
		depth++;
	} catch (DOMException e) {
		throw new SAXException(e.getMessage(), e);
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:46,代碼來源:NodeCreateRule.java

示例12: processingInstruction

import org.w3c.dom.DOMException; //導入方法依賴的package包/類
/**
 * Adds a new {@link org.w3c.dom.ProcessingInstruction
 * ProcessingInstruction} to the current node.
 * 
 * @param target
 *            the processing instruction target
 * @param data
 *            the processing instruction data, or null if none was
 *            supplied
 * @throws SAXException
 *             if the DOM implementation throws an exception
 */
@Override
public void processingInstruction(String target, String data) throws SAXException {

	try {
		top.appendChild(doc.createProcessingInstruction(target, data));
	} catch (DOMException e) {
		throw new SAXException(e.getMessage(), e);
	}

}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:23,代碼來源:NodeCreateRule.java


注:本文中的org.w3c.dom.DOMException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。