• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / httpunit / 636

05 Dec 2025 03:27AM UTC coverage: 80.509%. Remained the same
636

push

github

hazendaz
Cleanup more old since tags

you guessed it, at this point going to jautodoc the rest so the warnings on builds go away ;)

3213 of 4105 branches covered (78.27%)

Branch coverage included in aggregate %.

8249 of 10132 relevant lines covered (81.42%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/meterware/httpunit/javascript/events/Event.java
1
/*
2
 * MIT License
3
 *
4
 * Copyright 2011-2025 Russell Gold
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
7
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
8
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
9
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
 *
11
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions
12
 * of the Software.
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
15
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
17
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
 * DEALINGS IN THE SOFTWARE.
19
 */
20
package com.meterware.httpunit.javascript.events;
21

22
import org.mozilla.javascript.ScriptableObject;
23

24
public abstract class Event extends ScriptableObject {
×
25
    // -- Scriptable interface ------------------------------------------------------------------
26

27
    private static final long serialVersionUID = 1L;
28

29
    /** JavaScript class name. */
30
    private static final String JS_CLASS_NAME = "Event";
31

32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public String getClassName() {
37
        return JS_CLASS_NAME;
×
38
    }
39

40
    // -- DOM2 Events specification -------------------------------------------------------------
41

42
    /**
43
     * The current event phase is the capturing phase.
44
     */
45
    public static final short CAPTURING_PHASE = 1;
46

47
    /**
48
     * The event is currently being evaluated at the target EventTarget.
49
     */
50
    public static final short AT_TARGET = 2;
51

52
    /**
53
     * The current event phase is the bubbling phase.
54
     */
55
    public static final short BUBBLING_PHASE = 3;
56

57
    /**
58
     * The name of the event (case-insensitive). The name must be an XML name.
59
     */
60
    private String type;
61

62
    /**
63
     * Used to indicate whether or not an event is a bubbling event. If the event can bubble the value is true, else the
64
     * value is false.
65
     */
66
    private boolean bubbles;
67

68
    /**
69
     * Used to indicate whether or not an event can have its default action prevented. If the default action can be
70
     * prevented the value is true, else the value is false.
71
     */
72
    private boolean cancelable;
73

74
    /**
75
     * Used to specify the time (in milliseconds relative to the epoch) at which the event was created. Due to the fact
76
     * that some systems may not provide this information the value of timeStamp may be not available for all events.
77
     * When not available, a value of 0 will be returned. Examples of epoch time are the time of the system start or
78
     * 0:0:0 UTC 1st January 1970.
79
     */
80
    private long timeStamp;
81

82
    /**
83
     * The name of the event (case-insensitive). The name must be an XML name.
84
     */
85
    public String jsGet_type() {
86
        return type;
×
87
    }
88

89
    /**
90
     * Used to indicate whether or not an event is a bubbling event. If the event can bubble the value is true, else the
91
     * value is false.
92
     */
93
    public boolean jsGet_bubbles() {
94
        return bubbles;
×
95
    }
96

97
    /**
98
     * Used to specify the time (in milliseconds relative to the epoch) at which the event was created. Due to the fact
99
     * that some systems may not provide this information the value of timeStamp may be not available for all events.
100
     * When not available, a value of 0 will be returned. Examples of epoch time are the time of the system start or
101
     * 0:0:0 UTC 1st January 1970.
102
     */
103
    public boolean jsGet_cancelable() {
104
        return cancelable;
×
105
    }
106

107
    /**
108
     * Used to specify the time (in milliseconds relative to the epoch) at which the event was created. Due to the fact
109
     * that some systems may not provide this information the value of timeStamp may be not available for all events.
110
     * When not available, a value of 0 will be returned. Examples of epoch time are the time of the system start or
111
     * 0:0:0 UTC 1st January 1970.
112
     */
113
    public long jsGet_timeStamp() {
114
        return timeStamp;
×
115
    }
116

117
    /**
118
     * Used to indicate the EventTarget to which the event was originally dispatched.
119
     */
120
    public abstract EventTarget jsGet_target();
121

122
    /**
123
     * Used to indicate the EventTarget whose EventListeners are currently being processed. This is particularly useful
124
     * during capturing and bubbling.
125
     */
126
    public abstract EventTarget jsGet_currentTarget();
127

128
    /**
129
     * Used to indicate which phase of event flow is currently being evaluated.
130
     */
131
    public abstract short jsGet_eventPhase();
132

133
    /**
134
     * The stopPropagation method is used prevent further propagation of an event during event flow. If this method is
135
     * called by any EventListener the event will cease propagating through the tree. The event will complete dispatch
136
     * to all listeners on the current EventTarget before event flow stops. This method may be used during any stage of
137
     * event flow.
138
     */
139
    public abstract void jsFunction_stopPropagation();
140

141
    /**
142
     * If an event is cancelable, the preventDefault method is used to signify that the event is to be canceled, meaning
143
     * any default action normally taken by the implementation as a result of the event will not occur. If, during any
144
     * stage of event flow, the preventDefault method is called the event is canceled. Any default action associated
145
     * with the event will not occur. Calling this method for a non-cancelable event has no effect. Once preventDefault
146
     * has been called it will remain in effect throughout the remainder of the event's propagation. This method may be
147
     * used during any stage of event flow.
148
     */
149
    public abstract void jsFunction_preventDefault();
150

151
    /**
152
     * The initEvent method is used to initialize the value of an Event created through the DocumentEvent interface.
153
     * This method may only be called before the Event has been dispatched via the dispatchEvent method, though it may
154
     * be called multiple times during that phase if necessary. If called multiple times the final invocation takes
155
     * precedence. If called from a subclass of Event interface only the values specified in the initEvent method are
156
     * modified, all other attributes are left unchanged.
157
     *
158
     * @param eventTypeArg
159
     *            Specifies the event type. This type may be any event type currently defined in this specification or a
160
     *            new event type.. The string must be an XML name. Any new event type must not begin with any upper,
161
     *            lower, or mixed case version of the string "DOM". This prefix is reserved for future DOM event sets.
162
     *            It is also strongly recommended that third parties adding their own events use their own prefix to
163
     *            avoid confusion and lessen the probability of conflicts with other new events.
164
     * @param canBubbleArg
165
     *            Specifies whether or not the event can bubble.
166
     * @param cancelableArg
167
     *            Specifies whether or not the event's default action can be prevented.
168
     */
169
    public void jsFunction_initEvent(String eventTypeArg, boolean canBubbleArg, boolean cancelableArg) {
170
        type = eventTypeArg;
×
171
        bubbles = canBubbleArg;
×
172
        cancelable = cancelableArg;
×
173
    }
×
174
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc