Name

DOMException

Synopsis

An instance of this class is thrown whenever an exception is raised by the DOM API. Unlike many Java APIs, the DOM API does not define specialized subclasses to define different categories of exceptions. Instead, a more specific exception type is specified by the public field code. The value of this field will be one of the constants defined by this class, which have the following meanings:

INDEX_SIZE_ERR

Indicates an out-of-bounds error for an array or string index.

DOMSTRING_SIZE_ERR

Indicates that a requested text is too big to fit into a String object. Exceptions of this type are intended for DOM implementations for other languages and should not occur in Java.

HIERARCHY_REQUEST_ERR

Indicates that an attempt was made to place a node somewhere illegal in the document tree hierarchy.

WRONG_DOCUMENT_ERR

Indicates an attempt to use a node with a document that is different than the document that created the node.

INVALID_CHARACTER_ERR

Indicates that an illegal character is used (in an element name, for example) .

NO_DATA_ALLOWED_ERR

Not currently used.

NO_MODIFICATION_ALLOWED_ERR

Indicates that an attempt was made to modify a node that is read-only and does not allow modifications. Entity, EntityReference, and Notation nodes, and all of their descendants are read-only.

NOT_FOUND_ERR

Indicates that a node was not found where it was expected.

NOT_SUPPORTED_ERR

Indicates that a method or property is not supported in the current DOM implementation.

INUSE_ATTRIBUTE_ERR ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.