本文整理汇总了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);
}
}