本文整理匯總了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);
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}