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;
09:
10: import org.apache.xerces.xni.Augmentations;
11:
12: /**
13: * The base XML event class. For a complete list of available events,
14: * refer to the <code>org.cyberneko.pull.event</code> package.
15: *
16: * @author Andy Clark
17: *
18: * @version $Id$
19: */
20: public class XMLEvent {
21:
22: //
23: // Constants
24: //
25:
26: /** Event type: document. */
27: public static final short DOCUMENT = 0;
28:
29: /** Event type: element. */
30: public static final short ELEMENT = 1;
31:
32: /** Event type: character content. */
33: public static final short CHARACTERS = 2;
34:
35: /** Event type: prefix mapping. */
36: public static final short PREFIX_MAPPING = 3;
37:
38: /** Event type: general entity. */
39: public static final short GENERAL_ENTITY = 4;
40:
41: /** Event type: comment. */
42: public static final short COMMENT = 5;
43:
44: /** Event type: processing instruction. */
45: public static final short PROCESSING_INSTRUCTION = 6;
46:
47: /** Event type: CDATA section. */
48: public static final short CDATA = 7;
49:
50: /** Event type: text declaration. */
51: public static final short TEXT_DECL = 8;
52:
53: /** Event type: DOCTYPE declaration. */
54: public static final short DOCTYPE_DECL = 9;
55:
56: //
57: // Data
58: //
59:
60: /**
61: * Event type. This field is final and must be set within the constructor
62: * of any subclass.
63: */
64: public final short type;
65:
66: /** Event augmentations. */
67: public Augmentations augs;
68:
69: /**
70: * Next event, if used in an event chain. Typically, only a single
71: * event is returned at a time. However, this field is present to
72: * enable higher-level constructs to chain events together. For
73: * example, this can be useful to avoid concatenating the contents
74: * of character buffers, etc.
75: */
76: public XMLEvent next;
77:
78: //
79: // Constructors
80: //
81:
82: /** Constructs an XML event with the specified type. */
83: public XMLEvent(short type) {
84: this .type = type;
85: } // <init>(short)
86:
87: } // class XMLEvent
|