Class DOMException

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.dom.DOMException
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class DOMException extends HtmlUnitScriptable
Exception for DOM manipulations.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Abort error.
    private final int
     
    static final int
    Data clone error.
    static final int
    If the specified range of text does not fit into a DOMString.
    private String
     
    static final int
    If any node is inserted somewhere it doesn't belong.
    static final int
    If index or size is negative, or greater than the allowed value.
    static final int
    If an attempt is made to add an attribute that is already in use elsewhere.
    static final int
    If a parameter or an operation is not supported by the underlying object.
    static final int
    If an invalid or illegal character is specified, such as in a name.
    static final int
    If an attempt is made to modify the type of the underlying object.
    static final int
    Invalid node type error.
    static final int
    If an attempt is made to use an object that is not, or is no longer, usable.
    private int
     
    private final String
     
    static final int
    If an attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    static final int
    Network error.
    static final int
    If data is specified for a node which does not support data.
    static final int
    If an attempt is made to modify an object where modifications are not allowed.
    static final int
    If an attempt is made to reference a node in a context where it does not exist.
    static final int
    If the implementation does not support the requested type of object or operation.
    static final int
    Quota exceeded error.
    static final int
    Security error.
    static final int
    If an invalid or illegal string is specified.
    static final int
    Timeout error.
    static final int
    If the type of an object is incompatible with the expected type of the parameter.
    static final int
    URL mismatch error.
    static final int
    If a call to a method would make the Node invalid with respect to "partial validity".
    static final int
    If a node is used in a different document than the one that created it (that doesn't support it).

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor used to build the prototype.
    DOMException(String message, int errorCode)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the exception code.
    Gets the name of the in which the exception occurred.
    Gets the line at which the exception occurred.
    Gets the exception message.
    void
    JavaScript constructor.
    void
    setLocation(String fileName, int lineNumber)
    Sets the location in JavaScript source where this exception occurred.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DOMSTRING_SIZE_ERR

      public static final int DOMSTRING_SIZE_ERR
      If the specified range of text does not fit into a DOMString.
      See Also:
    • HIERARCHY_REQUEST_ERR

      public static final int HIERARCHY_REQUEST_ERR
      If any node is inserted somewhere it doesn't belong.
      See Also:
    • INDEX_SIZE_ERR

      public static final int INDEX_SIZE_ERR
      If index or size is negative, or greater than the allowed value.
      See Also:
    • INUSE_ATTRIBUTE_ERR

      public static final int INUSE_ATTRIBUTE_ERR
      If an attempt is made to add an attribute that is already in use elsewhere.
      See Also:
    • INVALID_ACCESS_ERR

      public static final int INVALID_ACCESS_ERR
      If a parameter or an operation is not supported by the underlying object.
      See Also:
    • INVALID_CHARACTER_ERR

      public static final int INVALID_CHARACTER_ERR
      If an invalid or illegal character is specified, such as in a name.
      See Also:
    • INVALID_MODIFICATION_ERR

      public static final int INVALID_MODIFICATION_ERR
      If an attempt is made to modify the type of the underlying object.
      See Also:
    • INVALID_STATE_ERR

      public static final int INVALID_STATE_ERR
      If an attempt is made to use an object that is not, or is no longer, usable.
      See Also:
    • NAMESPACE_ERR

      public static final int NAMESPACE_ERR
      If an attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
      See Also:
    • NO_DATA_ALLOWED_ERR

      public static final int NO_DATA_ALLOWED_ERR
      If data is specified for a node which does not support data.
      See Also:
    • NO_MODIFICATION_ALLOWED_ERR

      public static final int NO_MODIFICATION_ALLOWED_ERR
      If an attempt is made to modify an object where modifications are not allowed.
      See Also:
    • NOT_FOUND_ERR

      public static final int NOT_FOUND_ERR
      If an attempt is made to reference a node in a context where it does not exist.
      See Also:
    • NOT_SUPPORTED_ERR

      public static final int NOT_SUPPORTED_ERR
      If the implementation does not support the requested type of object or operation.
      See Also:
    • SYNTAX_ERR

      public static final int SYNTAX_ERR
      If an invalid or illegal string is specified.
      See Also:
    • WRONG_DOCUMENT_ERR

      public static final int WRONG_DOCUMENT_ERR
      If a node is used in a different document than the one that created it (that doesn't support it).
      See Also:
    • VALIDATION_ERR

      public static final int VALIDATION_ERR
      If a call to a method would make the Node invalid with respect to "partial validity".
      See Also:
    • TYPE_MISMATCH_ERR

      public static final int TYPE_MISMATCH_ERR
      If the type of an object is incompatible with the expected type of the parameter.
      See Also:
    • SECURITY_ERR

      public static final int SECURITY_ERR
      Security error.
      See Also:
    • NETWORK_ERR

      public static final int NETWORK_ERR
      Network error.
      See Also:
    • ABORT_ERR

      public static final int ABORT_ERR
      Abort error.
      See Also:
    • URL_MISMATCH_ERR

      public static final int URL_MISMATCH_ERR
      URL mismatch error.
      See Also:
    • QUOTA_EXCEEDED_ERR

      public static final int QUOTA_EXCEEDED_ERR
      Quota exceeded error.
      See Also:
    • TIMEOUT_ERR

      public static final int TIMEOUT_ERR
      Timeout error.
      See Also:
    • INVALID_NODE_TYPE_ERR

      public static final int INVALID_NODE_TYPE_ERR
      Invalid node type error.
      See Also:
    • DATA_CLONE_ERR

      public static final int DATA_CLONE_ERR
      Data clone error.
      See Also:
    • code_

      private final int code_
    • message_

      private final String message_
    • lineNumber_

      private int lineNumber_
    • fileName_

      private String fileName_
  • Constructor Details

    • DOMException

      public DOMException()
      Default constructor used to build the prototype.
    • DOMException

      public DOMException(String message, int errorCode)
      Constructor.
      Parameters:
      message - the exception message
      errorCode - the error code
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
    • getCode

      public Object getCode()
      Gets the exception code.
      Returns:
      the exception code
    • getMessage

      public Object getMessage()
      Gets the exception message.
      Returns:
      the exception message
    • getLineNumber

      public Object getLineNumber()
      Gets the line at which the exception occurred.
      Returns:
      the line of the exception
    • getFilename

      public Object getFilename()
      Gets the name of the in which the exception occurred.
      Returns:
      the name of the source file
    • setLocation

      public void setLocation(String fileName, int lineNumber)
      Sets the location in JavaScript source where this exception occurred.
      Parameters:
      fileName - the name of the source file
      lineNumber - the line number