Module org.htmlunit

Class CloseEvent

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class CloseEvent extends Event
JavaScript host object for CloseEvent.
Author:
Ahmed Ashour, Ronald Brill
See Also:
  • Constructor Details

    • CloseEvent

      public CloseEvent()
      Creates a new event instance.
  • Method Details

    • eventCreated

      public void eventCreated()
      Called whenever an event is created using Document.createEvent(..). This method is called after the parent scope was set so you are able to access the browser version.
      Overrides:
      eventCreated in class Event
    • jsConstructor

      public void jsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details)
      Creates an instance of this event.
      Overrides:
      jsConstructor in class Event
      Parameters:
      type - the event type
      details - the event details (optional)
    • getCode

      public int getCode()
      Returns the close code.
      Returns:
      the close code
    • setCode

      public void setCode(int code)
      Sets the close code.
      Parameters:
      code - the close code
    • getReason

      public String getReason()
      Returns the reason the connection was closed.
      Returns:
      the reason
    • setReason

      public void setReason(String reason)
      Sets the reason the connection was closed.
      Parameters:
      reason - the reason
    • isWasClean

      public boolean isWasClean()
      Returns whether the connection was closed cleanly.
      Returns:
      true if the connection was closed cleanly
    • setWasClean

      public void setWasClean(boolean wasClean)
      Sets whether the connection was closed cleanly.
      Parameters:
      wasClean - true if the connection was closed cleanly