KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > schema2beans > DDLogFlags


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.schema2beans;
21
22
23
24 /**
25  * Trace flag values
26  */

27 public class DDLogFlags extends Object JavaDoc
28 {
29     public String JavaDoc dbgNames[];
30     public Object JavaDoc actionSets[];
31
32     // DTD/Internal tree Parsing traces
33
public static final int DBG_DTD = 12;
34
35     // Internal Tree traces (BeanProp/DOMBinding...)
36
public static final int DBG_BLD = 13;
37
38     // Events traces
39
public static final int DBG_EVT = 14;
40
41     // User Bean traces (BaseBean)
42
public static final int DBG_UBN = 15;
43
44     // Registry traces (DDRegistry)
45
public static final int DBG_REG = 16;
46     
47     /**
48      * Maximum group level trace - please maintain up to date.
49      */

50     public static final int MAX_DBG_GROUP = 16;
51     
52     
53     /**
54      * Can be dynamically changed to trigger the traces
55      * (see GraphManager.debug() method)
56      */

57     public static boolean debug = false;
58     public static void setDebug(boolean d) {debug = d;}
59     static {
60         // Use -J-Dschema2beans.debug=true to runide
61
String JavaDoc externalDebug = System.getProperty("schema2beans.debug");
62         if (externalDebug != null) {
63             debug = true;
64         }
65     }
66
67     
68     //
69
// Action ids - DOM_BASIC tracing
70
//
71
public static final int FINDNODE = 1;
72     public static final int GETTEXT = 2;
73     public static final int SETTEXT = 3;
74     public static final int GETIDXTEXT = 4;
75     public static final int SETIDXTEXT = 5;
76     public static final int DDCREATE = 6;
77     public static final int DDCREATED = 7;
78     public static final int DDBEANED = 8;
79     public static final int FOUNDNODE = 9;
80     public static final int BOUNDNODE = 10;
81     public static final int NONODE = 11;
82     public static final int NOTELT = 12;
83     public static final int BINDPROP = 13;
84     public static final int EXCEEDED = 14;
85     public static final int SETVALUE = 15;
86     public static final int NEWBIND = 16;
87     public static final int SYNCNODES = 17;
88     public static final int CACHING = 18;
89     public static final int SYNCING = 19;
90     public static final int DELETENODE = 20;
91     public static final int BEANCOMP = 21;
92     public static final int PROPCOMP = 22;
93     public static final int CREATEATTR = 23;
94     public static final int GETATTR = 24;
95     
96     //
97
// Action names - Internal tree tracing
98
//
99
static final String JavaDoc[] bldActionNames = // BEGIN_NOI18N
100
{
101     "FINDNODE ",
102     "GETTEXT ",
103     "SETTEXT ",
104     "GETIDXTEXT ",
105     "SETIDXTEXT ",
106     "DDCREATE ",
107     "DDCREATED ",
108     "DDBEANED ",
109     "FOUNDNODE ",
110     "BOUNDNODE ",
111     "NONODE ",
112     "NOTELT ",
113     "BINDPROP ",
114     "EXCEEDED ",
115     "SETVALUE ",
116     "NEWBIND ",
117     "SYNCNODES ",
118     "CACHING ",
119     "SYNCING ",
120     "DELETENODE ",
121     "BEANCOMP ",
122     "PROPCOMP ",
123     "CREATEATTR ",
124     "GETATTR "
125     }; // END_NOI18N
126

127     
128     //
129
// Action ids - DTD parsing tracing
130
//
131
public static final int STARTDOC = 1;
132     public static final int ENDDOC = 2;
133     public static final int STARTELT = 3;
134     public static final int ENDELT = 4;
135     public static final int ELEMENT = 5;
136     public static final int STARTGRP = 6;
137     public static final int ENDGRP = 7;
138     
139     //
140
// Action names - DOM_BASIC tracing
141
//
142
static final String JavaDoc[] dtdActionNames = // BEGIN_NOI18N
143
{
144     "STARTDOC ",
145     "ENDDOC ",
146     "STARTELT ",
147     "ENDELT ",
148     "ELEMENT ",
149     "STARTGRP ",
150     "ENDGRP "
151     }; // END_NOI18N
152

153     //
154
// Events ids
155
//
156
public static final int CREATECHG = 1;
157     public static final int CREATEREM = 2;
158     public static final int NOTIFYCHG = 3;
159     public static final int NOTIFYREM = 4;
160     public static final int VETOABLE = 5;
161     public static final int NOTIFYVETO = 6;
162     
163     
164     //
165
// Action names - DOM_BASIC tracing
166
//
167
static final String JavaDoc[] evtActionNames = // BEGIN_NOI18N
168
{
169     "CREATECHG ",
170     "CREATEREM ",
171     "NOTIFYCHG ",
172     "NOTIFYREM ",
173     "VETOABLE ",
174     "NOTIFYVETO "
175     }; // END_NOI18N
176

177     
178     //
179
// User bean traces
180
//
181
public static final int MERGE = 1;
182     public static final int MERGEPROP = 2;
183     public static final int MERGEFOUND = 3;
184     public static final int MERGENTFND = 4;
185     public static final int EQUALS = 5;
186     public static final int FIND = 6;
187     public static final int FINDATTR = 7;
188     public static final int FINDCMP = 8;
189     public static final int FNDATTR = 9;
190     public static final int FINDPROP = 10;
191     public static final int FNDPROP = 11;
192     
193     
194     //
195
// Action names - DOM_BASIC tracing
196
//
197
static final String JavaDoc[] ubnActionNames = // BEGIN_NOI18N
198
{
199     "MERGE ",
200     "MERGEPROP ",
201     "MERGEFOUND ",
202     "MERGENTFND ",
203     "EQUALS ",
204     "FIND ",
205     "FINDATTR ",
206     "FINDCMP ",
207     "FNDATTR ",
208     "FINDPROP ",
209     "FNDPROP "
210     // "EVENTNEW ",
211
}; // END_NOI18N
212

213     
214     //
215
// Registry traces
216
//
217

218     public static final int ADDTYPE = 1;
219     
220     
221     //
222
// Action names - DD Registry/Parsing tracing
223
//
224
static final String JavaDoc[] regActionNames = // BEGIN_NOI18N
225
{
226     "ADDTYPE ",
227     //" ",
228
}; // END_NOI18N
229

230     
231     
232     public DDLogFlags() // BEGIN_NOI18N
233
{
234     super();
235     dbgNames = new String JavaDoc[TraceLogger.MAXGROUP];
236     dbgNames[DBG_DTD - 1] = "dtd";
237     dbgNames[DBG_BLD - 1] = "ibn";
238     dbgNames[DBG_EVT - 1] = "evt";
239     dbgNames[DBG_UBN - 1] = "ubn";
240     dbgNames[DBG_REG - 1] = "reg";
241     
242     actionSets = new Object JavaDoc[TraceLogger.MAXGROUP];
243     actionSets[DBG_DTD - 1] = dtdActionNames;
244     actionSets[DBG_BLD - 1] = bldActionNames;
245     actionSets[DBG_EVT - 1] = evtActionNames;
246     actionSets[DBG_UBN - 1] = ubnActionNames;
247     actionSets[DBG_REG - 1] = regActionNames;
248     } // END_NOI18N
249
}
250
Popular Tags