6
|
1 |
/*
|
|
2 |
* reserved comment block
|
|
3 |
* DO NOT REMOVE OR ALTER!
|
|
4 |
*/
|
|
5 |
/*
|
|
6 |
* Copyright 1999-2004 The Apache Software Foundation.
|
|
7 |
*
|
|
8 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9 |
* you may not use this file except in compliance with the License.
|
|
10 |
* You may obtain a copy of the License at
|
|
11 |
*
|
|
12 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13 |
*
|
|
14 |
* Unless required by applicable law or agreed to in writing, software
|
|
15 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17 |
* See the License for the specific language governing permissions and
|
|
18 |
* limitations under the License.
|
|
19 |
*/
|
|
20 |
/*
|
|
21 |
* $Id: SerializerTrace.java,v 1.2.4.1 2005/09/15 08:15:24 suresh_emailid Exp $
|
|
22 |
*/
|
|
23 |
package com.sun.org.apache.xml.internal.serializer;
|
|
24 |
|
|
25 |
import org.xml.sax.Attributes;
|
|
26 |
|
|
27 |
/**
|
|
28 |
* This interface defines a set of integer constants that identify trace event
|
|
29 |
* types.
|
|
30 |
*
|
|
31 |
* @xsl.usage internal
|
|
32 |
*/
|
|
33 |
|
|
34 |
public interface SerializerTrace {
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Event type generated when a document begins.
|
|
38 |
*
|
|
39 |
*/
|
|
40 |
public static final int EVENTTYPE_STARTDOCUMENT = 1;
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Event type generated when a document ends.
|
|
44 |
*/
|
|
45 |
public static final int EVENTTYPE_ENDDOCUMENT = 2;
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Event type generated when an element begins (after the attributes have been processed but before the children have been added).
|
|
49 |
*/
|
|
50 |
public static final int EVENTTYPE_STARTELEMENT = 3;
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Event type generated when an element ends, after it's children have been added.
|
|
54 |
*/
|
|
55 |
public static final int EVENTTYPE_ENDELEMENT = 4;
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Event type generated for character data (CDATA and Ignorable Whitespace have their own events).
|
|
59 |
*/
|
|
60 |
public static final int EVENTTYPE_CHARACTERS = 5;
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Event type generated for ignorable whitespace (I'm not sure how much this is actually called.
|
|
64 |
*/
|
|
65 |
public static final int EVENTTYPE_IGNORABLEWHITESPACE = 6;
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Event type generated for processing instructions.
|
|
69 |
*/
|
|
70 |
public static final int EVENTTYPE_PI = 7;
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Event type generated after a comment has been added.
|
|
74 |
*/
|
|
75 |
public static final int EVENTTYPE_COMMENT = 8;
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Event type generate after an entity ref is created.
|
|
79 |
*/
|
|
80 |
public static final int EVENTTYPE_ENTITYREF = 9;
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Event type generated after CDATA is generated.
|
|
84 |
*/
|
|
85 |
public static final int EVENTTYPE_CDATA = 10;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Event type generated when characters might be written to an output stream,
|
|
89 |
* but these characters never are. They will ultimately be written out via
|
|
90 |
* EVENTTYPE_OUTPUT_CHARACTERS. This type is used as attributes are collected.
|
|
91 |
* Whenever the attributes change this event type is fired. At the very end
|
|
92 |
* however, when the attributes do not change anymore and are going to be
|
|
93 |
* ouput to the document the real characters will be written out using the
|
|
94 |
* EVENTTYPE_OUTPUT_CHARACTERS.
|
|
95 |
*/
|
|
96 |
public static final int EVENTTYPE_OUTPUT_PSEUDO_CHARACTERS = 11;
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Event type generated when characters are written to an output stream.
|
|
100 |
*/
|
|
101 |
public static final int EVENTTYPE_OUTPUT_CHARACTERS = 12;
|
|
102 |
|
|
103 |
|
|
104 |
/**
|
|
105 |
* Tell if trace listeners are present.
|
|
106 |
*
|
|
107 |
* @return True if there are trace listeners
|
|
108 |
*/
|
|
109 |
public boolean hasTraceListeners();
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Fire startDocument, endDocument events.
|
|
113 |
*
|
|
114 |
* @param eventType One of the EVENTTYPE_XXX constants.
|
|
115 |
*/
|
|
116 |
public void fireGenerateEvent(int eventType);
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Fire startElement, endElement events.
|
|
120 |
*
|
|
121 |
* @param eventType One of the EVENTTYPE_XXX constants.
|
|
122 |
* @param name The name of the element.
|
|
123 |
* @param atts The SAX attribute list.
|
|
124 |
*/
|
|
125 |
public void fireGenerateEvent(int eventType, String name, Attributes atts);
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Fire characters, cdata events.
|
|
129 |
*
|
|
130 |
* @param eventType One of the EVENTTYPE_XXX constants.
|
|
131 |
* @param ch The char array from the SAX event.
|
|
132 |
* @param start The start offset to be used in the char array.
|
|
133 |
* @param length The end offset to be used in the chara array.
|
|
134 |
*/
|
|
135 |
public void fireGenerateEvent(int eventType, char ch[], int start, int length);
|
|
136 |
|
|
137 |
/**
|
|
138 |
* Fire processingInstruction events.
|
|
139 |
*
|
|
140 |
* @param eventType One of the EVENTTYPE_XXX constants.
|
|
141 |
* @param name The name of the processing instruction.
|
|
142 |
* @param data The processing instruction data.
|
|
143 |
*/
|
|
144 |
public void fireGenerateEvent(int eventType, String name, String data);
|
|
145 |
|
|
146 |
|
|
147 |
/**
|
|
148 |
* Fire comment and entity ref events.
|
|
149 |
*
|
|
150 |
* @param eventType One of the EVENTTYPE_XXX constants.
|
|
151 |
* @param data The comment or entity ref data.
|
|
152 |
*/
|
|
153 |
public void fireGenerateEvent(int eventType, String data);
|
|
154 |
|
|
155 |
}
|