Java Code Examples for org.w3c.dom.DOMException#TYPE_MISMATCH_ERR

The following examples show how to use org.w3c.dom.DOMException#TYPE_MISMATCH_ERR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DOMParserImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 2
Source File: DOMParserImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 3
Source File: DOMParserImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 4
Source File: DOMParserImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 5
Source File: DOMParserImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 6
Source File: DOMParserImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 7
Source File: DOMParserImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 8
Source File: DOMConfigurationImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage(
            DOMMessageFormatter.DOM_DOMAIN,
            "TYPE_MISMATCH_ERR",
            new Object[] { name });
    return new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 9
Source File: DOMParserImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 10
Source File: DOMParserImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 11
Source File: DOMParserImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 12
Source File: DOMParserImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static DOMException newTypeMismatchError(String name) {
    String msg =
        DOMMessageFormatter.formatMessage (
                DOMMessageFormatter.DOM_DOMAIN,
                "TYPE_MISMATCH_ERR",
                new Object[] { name });
    return new DOMException (DOMException.TYPE_MISMATCH_ERR, msg);
}
 
Example 13
Source File: SVGElement.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Node appendChild(final Node newChild) {
	if(!(newChild instanceof SVGElement)) {
		throw new DOMException(DOMException.TYPE_MISMATCH_ERR, "SVGElement excepted here."); //NON-NLS
	}

	children.getNodes().remove(newChild);

	children.getNodes().add((SVGElement) newChild);
	((SVGElement) newChild).setParent(this);

	return newChild;
}
 
Example 14
Source File: SVGDocument.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public SVGSVGElement adoptNode(final Node source) {
	if(!(source instanceof SVGSVGElement)) {
		throw new DOMException(DOMException.TYPE_MISMATCH_ERR, "SVGSVGElement expected here.");
	}

	root = (SVGSVGElement) source;
	root.setOwnerDocument(this);

	return root;
}
 
Example 15
Source File: Element.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/**
    * Adds a new attribute node. If an attribute with that name (
    * <code>nodeName</code>) is already present in the element, it is
    * replaced by the new one. Replacing an attribute node by itself has no
    * effect.
    * <br>To add a new attribute node with a qualified name and namespace
    * URI, use the <code>setAttributeNodeNS</code> method.
    * @param newAttr The <code>Attr</code> node to add to the attribute list.
    * @return If the <code>newAttr</code> attribute replaces an existing
    *   attribute, the replaced <code>Attr</code> node is returned,
    *   otherwise <code>null</code> is returned.
    * @exception DOMException
    *   WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a
    *   different document than the one that created the element.
    *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
    *   <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an
    *   attribute of another <code>Element</code> object. The DOM user must
    *   explicitly clone <code>Attr</code> nodes to re-use them in other
    *   elements.
    */
   public Attribute setAttributeNode(org.w3c.dom.Attr newAttr) {
checkNotInTree();
if(newAttr instanceof Attribute) {
    Attribute attribute = (Attribute)newAttr;
    Attribute oldAttr = getAttributeNode(newAttr.getName());
    if (oldAttr==null) {
	getAttributesForWrite().add(attribute);
	return attribute;
    } else {
	int index = getAttributesForRead().indexOf(oldAttr);
	return getAttributesForWrite().set(index,attribute);
    }
} else {
    throw new DOMException(DOMException.TYPE_MISMATCH_ERR,null);
}
   }