01: /*
02: * (C) Copyright 2002-2003, Andy Clark. All rights reserved.
03: *
04: * This file is distributed under an Apache style license. Please
05: * refer to the LICENSE file for specific details.
06: */
07:
08: package org.cyberneko.pull.event;
09:
10: import org.cyberneko.pull.XMLEvent;
11:
12: import org.apache.xerces.util.XMLAttributesImpl;
13: import org.apache.xerces.xni.QName;
14: import org.apache.xerces.xni.XMLAttributes;
15:
16: /**
17: * An element event. This event communicates both the start element and
18: * end element events. In addition, this event allows the application
19: * to query whether the element tag represented by this event was
20: * <em>empty</em>. In other words, whether the tag appears as
21: * "<root></root>" or "<root/>".
22: *
23: * @author Andy Clark
24: *
25: * @version $Id$
26: */
27: public class ElementEvent extends BoundedEvent {
28:
29: //
30: // Data
31: //
32:
33: /** The qualified name of the element. */
34: public QName element;
35:
36: /**
37: * The attributes for the <em>start</em> element. This value will be
38: * null for end elements.
39: */
40: public XMLAttributes attributes;
41:
42: /**
43: * True if this element is an empty element, for example <root/>.
44: * <p>
45: * <strong>Note:</strong>
46: * The pull parser will always report both a start and end element event
47: * for empty elements. This allows applications to deal with elements in
48: * a consistent manner. However, both the start and end element event
49: * objects of an empty element will have the <code>empty</code> field
50: * set to <code>true</code>.
51: */
52: public boolean empty;
53:
54: //
55: // Constructors
56: //
57:
58: /** Default constructor. */
59: public ElementEvent() {
60: super (XMLEvent.ELEMENT);
61: } // <init>()
62:
63: } // class ElementEvent
|