KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > dsmlv2 > request > Dsmlv2Grammar


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.dsmlv2.request;
22
23
24 import java.io.IOException JavaDoc;
25 import java.lang.reflect.Array JavaDoc;
26 import java.util.HashMap JavaDoc;
27
28 import javax.naming.InvalidNameException JavaDoc;
29
30 import org.apache.directory.ldapstudio.dsmlv2.AbstractGrammar;
31 import org.apache.directory.ldapstudio.dsmlv2.Dsmlv2Container;
32 import org.apache.directory.ldapstudio.dsmlv2.Dsmlv2StatesEnum;
33 import org.apache.directory.ldapstudio.dsmlv2.GrammarAction;
34 import org.apache.directory.ldapstudio.dsmlv2.GrammarTransition;
35 import org.apache.directory.ldapstudio.dsmlv2.IGrammar;
36 import org.apache.directory.ldapstudio.dsmlv2.ParserUtils;
37 import org.apache.directory.ldapstudio.dsmlv2.Tag;
38 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.OnError;
39 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.Processing;
40 import org.apache.directory.ldapstudio.dsmlv2.request.BatchRequest.ResponseOrder;
41 import org.apache.directory.shared.asn1.Asn1Object;
42 import org.apache.directory.shared.asn1.codec.DecoderException;
43 import org.apache.directory.shared.asn1.primitives.OID;
44 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
45 import org.apache.directory.shared.ldap.codec.Control;
46 import org.apache.directory.shared.ldap.codec.LdapConstants;
47 import org.apache.directory.shared.ldap.codec.abandon.AbandonRequest;
48 import org.apache.directory.shared.ldap.codec.add.AddRequest;
49 import org.apache.directory.shared.ldap.codec.bind.BindRequest;
50 import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
51 import org.apache.directory.shared.ldap.codec.compare.CompareRequest;
52 import org.apache.directory.shared.ldap.codec.del.DelRequest;
53 import org.apache.directory.shared.ldap.codec.extended.ExtendedRequest;
54 import org.apache.directory.shared.ldap.codec.modify.ModifyRequest;
55 import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequest;
56 import org.apache.directory.shared.ldap.codec.search.AndFilter;
57 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
58 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
59 import org.apache.directory.shared.ldap.codec.search.Filter;
60 import org.apache.directory.shared.ldap.codec.search.NotFilter;
61 import org.apache.directory.shared.ldap.codec.search.OrFilter;
62 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
63 import org.apache.directory.shared.ldap.codec.search.SearchRequest;
64 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
65 import org.apache.directory.shared.ldap.message.ScopeEnum;
66 import org.apache.directory.shared.ldap.name.LdapDN;
67 import org.apache.directory.shared.ldap.name.Rdn;
68 import org.apache.directory.shared.ldap.util.Base64;
69 import org.apache.directory.shared.ldap.util.StringTools;
70 import org.xmlpull.v1.XmlPullParser;
71 import org.xmlpull.v1.XmlPullParserException;
72
73
74 /**
75  * This Class represents the DSMLv2 Request Grammar
76  *
77  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
78  * @version $Rev$, $Date$
79  */

80 public class Dsmlv2Grammar extends AbstractGrammar implements IGrammar
81 {
82     /** The instance of grammar. Dsmlv2Grammar is a singleton */
83     private static Dsmlv2Grammar instance = new Dsmlv2Grammar();
84
85
86     /**
87      * Creates a new instance of Dsmlv2Grammar.
88      */

89     @SuppressWarnings JavaDoc("unchecked")
90     private Dsmlv2Grammar()
91     {
92         name = Dsmlv2Grammar.class.getName();
93         statesEnum = Dsmlv2StatesEnum.getInstance();
94
95         // Create the transitions table
96
super.transitions = ( HashMap JavaDoc<Tag, GrammarTransition>[] ) Array.newInstance( HashMap JavaDoc.class, 200 );; // TODO Change this value
97

98         //====================================================
99
// Transitions concerning : BATCH REQUEST
100
//====================================================
101
super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE] = new HashMap JavaDoc<Tag, GrammarTransition>();
102         super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
103         super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP] = new HashMap JavaDoc<Tag, GrammarTransition>();
104         super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
105
106         // ** OPEN BATCH REQUEST **
107
// State: [INIT_GRAMMAR_STATE] - Tag: <batchRequest>
108
super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE].put( new Tag( "batchRequest", Tag.START ),
109             new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
110                 batchRequestCreation ) );
111
112         // ** CLOSE BATCH REQUEST **
113
// state: [BATCHREQUEST_START_TAG] - Tag: </batchRequest>
114
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG]
115             .put( new Tag( "batchRequest", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
116                 Dsmlv2StatesEnum.BATCHREQUEST_END_TAG, null ) );
117         //state: [BATCHREQUEST_LOOP] - Tag: </batchRequest>
118
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "batchRequest", Tag.END ),
119             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.END_STATE, null ) );
120
121         // ** ABANDON REQUEST **
122
// State: [BATCHREQUEST_START_TAG] - Tag: <abandonRequest>
123
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "abandonRequest", Tag.START ),
124             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
125                 abandonRequestCreation ) );
126         // state: [BATCHREQUEST_LOOP] - Tag: <abandonRequest>
127
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "abandonRequest", Tag.START ),
128             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
129                 abandonRequestCreation ) );
130
131         // ** ADD REQUEST **
132
// state: [BATCHREQUEST_START_TAG] - Tag: <addRequest>
133
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "addRequest", Tag.START ),
134             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
135                 addRequestCreation ) );
136         // state: [BATCHREQUEST_LOOP] - Tag: <addRequest>
137
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "addRequest", Tag.START ),
138             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
139                 addRequestCreation ) );
140
141         // ** AUTH REQUEST **
142
// state: [BATCHREQUEST_START_TAG] - Tag: <authRequest>
143
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "authRequest", Tag.START ),
144             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG,
145                 authRequestCreation ) );
146
147         // ** COMPARE REQUEST **
148
// state: [BATCHREQUEST_START_TAG] - Tag: <compareRequest>
149
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "compareRequest", Tag.START ),
150             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
151                 compareRequestCreation ) );
152         // state: [BATCHREQUEST_LOOP] - Tag: <compareRequest>
153
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "compareRequest", Tag.START ),
154             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
155                 compareRequestCreation ) );
156
157         // ** DEL REQUEST **
158
// state: [BATCHREQUEST_START_TAG] - Tag: <delRequest>
159
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "delRequest", Tag.START ),
160             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
161                 delRequestCreation ) );
162         // state: [BATCHREQUEST_LOOP] - Tag: <delRequest>
163
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "delRequest", Tag.START ),
164             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
165                 delRequestCreation ) );
166
167         // ** EXTENDED REQUEST **
168
// state: [BATCHREQUEST_START_TAG] - Tag: <extendedRequest>
169
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "extendedRequest", Tag.START ),
170             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
171                 Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, extendedRequestCreation ) );
172         // state: [BATCHREQUEST_LOOP] - Tag: <extendedRequest>
173
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "extendedRequest", Tag.START ),
174             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
175                 extendedRequestCreation ) );
176
177         // ** MOD DN REQUEST **
178
// state: [BATCHREQUEST_START_TAG] - Tag: <modDNRequest>
179
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "modDNRequest", Tag.START ),
180             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
181                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, modDNRequestCreation ) );
182         // state: [BATCHREQUEST_LOOP] - Tag: <modDNRequest>
183
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "modDNRequest", Tag.START ),
184             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG,
185                 modDNRequestCreation ) );
186
187         // ** MODIFY REQUEST **
188
// state: [BATCHREQUEST_START_TAG] - Tag: <modifyRequest>
189
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "modifyRequest", Tag.START ),
190             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
191                 modifyRequestCreation ) );
192         // state: [BATCHREQUEST_LOOP] - Tag: <modifyRequest>
193
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "modifyRequest", Tag.START ),
194             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
195                 modifyRequestCreation ) );
196
197         // ** SEARCH REQUEST **
198
// state: [BATCHREQUEST_START_TAG] - Tag: <searchRequest>
199
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG].put( new Tag( "searchRequest", Tag.START ),
200             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
201                 searchRequestCreation ) );
202         // state: [BATCHREQUEST_LOOP] - Tag: <searchRequest>
203
super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP].put( new Tag( "searchRequest", Tag.START ),
204             new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
205                 searchRequestCreation ) );
206
207         //====================================================
208
// Transitions concerning : ABANDON REQUEST
209
//====================================================
210
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
211         super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
212         super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
213         super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
214
215         // State: [ABANDON_REQUEST_START_TAG] - Tag: </abandonRequest>
216
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG]
217             .put( new Tag( "abandonRequest", Tag.END ), new GrammarTransition(
218                 Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
219
220         // State: [ABANDON_REQUEST_START_TAG] - Tag: <control>
221
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
222             new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
223                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) );
224
225         // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
226
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG].put(
227             new Tag( "controlValue", Tag.START ), new GrammarTransition(
228                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG,
229                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
230
231         // State: [ABANDON_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
232
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
233             new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG,
234                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) );
235
236         // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag: </control>
237
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
238             new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG,
239                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) );
240
241         // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: <control>
242
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
243             new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG,
244                 Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) );
245
246         // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: </abandonRequest>
247
super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG].put( new Tag( "abandonRequest", Tag.END ),
248             new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG,
249                 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
250
251         //====================================================
252
// Transitions concerning : ADD REQUEST
253
//====================================================
254
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
255         super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
256         super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
257         super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
258         super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
259         super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
260
261         // state: [ADD_REQUEST_START_TAG] -> Tag: </addRequest>
262
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "addRequest", Tag.END ),
263             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
264
265         // State: [ADD_REQUEST_START_TAG] - Tag: <control>
266
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
267             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
268                 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) );
269
270         // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
271
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ),
272             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG,
273                 Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
274
275         // State: [ADD_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
276
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
277             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG,
278                 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) );
279
280         // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: </control>
281
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
282             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG,
283                 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) );
284
285         // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: <control>
286
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
287             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG,
288                 Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) );
289
290         // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: </addRequest>
291
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "addRequest", Tag.END ),
292             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
293                 null ) );
294
295         // State: [ADD_REQUEST_START_TAG] - Tag: <attr>
296
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG].put( new Tag( "attr", Tag.START ),
297             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
298                 addRequestAddAttribute ) );
299
300         // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: <attr>
301
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG].put( new Tag( "attr", Tag.START ),
302             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG,
303                 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) );
304
305         // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: <attr>
306
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG].put( new Tag( "attr", Tag.START ),
307             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG,
308                 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) );
309
310         // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: </attr>
311
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG].put( new Tag( "attr", Tag.END ),
312             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
313                 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, null ) );
314
315         // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: <value>
316
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG].put( new Tag( "value", Tag.START ),
317             new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
318                 Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddValue ) );
319
320         // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: </addRequest>
321
super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG]
322             .put( new Tag( "addRequest", Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG,
323                 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
324
325         //====================================================
326
// Transitions concerning : AUTH REQUEST
327
//====================================================
328
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
329         super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
330         super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
331         super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
332
333         // state: [AUTH_REQUEST_START_TAG] -> Tag: </authRequest>
334
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG].put( new Tag( "authRequest", Tag.END ),
335             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
336
337         // State: [AUTH_REQUEST_START_TAG] - Tag: <control>
338
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
339             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG,
340                 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) );
341
342         // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
343
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ),
344             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG,
345                 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
346
347         // State: [AUTH_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
348
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
349             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG,
350                 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) );
351
352         // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: </control>
353
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
354             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG,
355                 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) );
356
357         // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: <control>
358
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
359             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG,
360                 Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) );
361
362         // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: </authRequest>
363
super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG].put( new Tag( "authRequest", Tag.END ),
364             new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
365                 null ) );
366
367         //====================================================
368
// Transitions concerning : COMPARE REQUEST
369
//====================================================
370
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
371         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
372         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
373         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
374         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
375         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
376         super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
377
378         // State: [COMPARE_REQUEST_START_TAG] - Tag: <control>
379
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
380             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
381                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) );
382
383         // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
384
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG].put(
385             new Tag( "controlValue", Tag.START ), new GrammarTransition(
386                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
387                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
388
389         // State: [COMPARE_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
390
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
391             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG,
392                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) );
393
394         // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: </control>
395
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
396             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
397                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) );
398
399         // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: <control>
400
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
401             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
402                 Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) );
403
404         // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: </compareRequest>
405
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "compareRequest", Tag.END ),
406             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
407                 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
408
409         // State: [COMPARE_REQUEST_START_TAG] - Tag: <assertion>
410
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG].put( new Tag( "assertion", Tag.START ),
411             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
412                 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) );
413
414         // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: <assertion>
415
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG].put( new Tag( "assertion", Tag.START ),
416             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
417                 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) );
418
419         // State: [COMPARE_REQUEST_ASSERTION_START_TAG] - Tag: <value>
420
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG].put( new Tag( "value", Tag.START ),
421             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG,
422                 Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, compareRequestAddValue ) );
423
424         //State: [COMPARE_REQUEST_VALUE_END_TAG] - Tag: </assertion>
425
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG].put( new Tag( "assertion", Tag.END ),
426             new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG,
427                 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, null ) );
428
429         // State: [COMPARE_REQUEST_ASSERTION_END_TAG] - Tag: </compareRequest>
430
super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG].put(
431             new Tag( "compareRequest", Tag.END ), new GrammarTransition(
432                 Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
433
434         //====================================================
435
// Transitions concerning : DEL REQUEST
436
//====================================================
437
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
438         super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
439         super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
440         super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
441
442         // State: [DEL_REQUEST_START_TAG] - Tag: </delRequest>
443
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG].put( new Tag( "delRequest", Tag.END ),
444             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
445
446         // State: [DEL_REQUEST_START_TAG] - Tag: <control>
447
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
448             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
449                 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) );
450
451         // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
452
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ),
453             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG,
454                 Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
455
456         // State: [DEL_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
457
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
458             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG,
459                 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) );
460
461         // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: </control>
462
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
463             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG,
464                 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) );
465
466         // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: <control>
467
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
468             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG,
469                 Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) );
470
471         // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: </delRequest>
472
super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG].put( new Tag( "delRequest", Tag.END ),
473             new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
474                 null ) );
475
476         //====================================================
477
// Transitions concerning : EXTENDED REQUEST
478
//====================================================
479
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
480         super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
481         super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
482         super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
483         super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
484         super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
485
486         // State: [EXTENDED_REQUEST_START_TAG] - Tag: <control>
487
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
488             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
489                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) );
490
491         // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
492
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG].put(
493             new Tag( "controlValue", Tag.START ), new GrammarTransition(
494                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG,
495                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
496
497         // State: [EXTENDED_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
498
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
499             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG,
500                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) );
501
502         // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: </control>
503
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
504             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG,
505                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) );
506
507         // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: <control>
508
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
509             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG,
510                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) );
511
512         // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: </extendedRequest>
513
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put(
514             new Tag( "extendedRequest", Tag.END ), new GrammarTransition(
515                 Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
516
517         // State: [EXTENDED_REQUEST_START_TAG] - Tag: <requestName>
518
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG].put( new Tag( "requestName", Tag.START ),
519             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
520                 Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) );
521
522         // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: <requestName>
523
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG].put( new Tag( "requestName", Tag.START ),
524             new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG,
525                 Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) );
526
527         // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: </extendedRequest>
528
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG].put( new Tag( "extendedRequest",
529             Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG,
530             Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
531
532         // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: <requestValue>
533
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG].put( new Tag( "requestValue",
534             Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG,
535             Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, extendedRequestAddValue ) );
536
537         // State: [EXTENDED_REQUEST_REQUESTVALUE_END_TAG] - Tag: </requestRequest>
538
super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG].put( new Tag( "extendedRequest",
539             Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG,
540             Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
541
542         //====================================================
543
// Transitions concerning : MODIFY DN REQUEST
544
//====================================================
545
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
546         super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
547         super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
548         super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
549
550         // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: </modDNRequest>
551
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG].put( new Tag( "modDNRequest", Tag.END ),
552             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
553                 null ) );
554
555         // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: <control>
556
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
557             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG,
558                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) );
559
560         // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
561
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG].put(
562             new Tag( "controlValue", Tag.START ), new GrammarTransition(
563                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG,
564                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
565
566         // State: [MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
567
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
568             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG,
569                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) );
570
571         // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: </control>
572
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
573             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG,
574                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) );
575
576         // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: <control>
577
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
578             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG,
579                 Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) );
580
581         // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: </modDNRequest>
582
super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG].put( new Tag( "modDNRequest", Tag.END ),
583             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG,
584                 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
585
586         //====================================================
587
// Transitions concerning : MODIFY REQUEST
588
//====================================================
589
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
590         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
591         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
592         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
593         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
594         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
595         super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
596
597         // State: [MODIFY_REQUEST_START_TAG] - Tag: </modifyRequest>
598
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG]
599             .put( new Tag( "modifyRequest", Tag.END ), new GrammarTransition(
600                 Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
601
602         // State: [MODIFY_REQUEST_START_TAG] - Tag: <control>
603
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
604             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
605                 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) );
606
607         // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
608
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ),
609             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG,
610                 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
611
612         // State: [MODIFY_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
613
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
614             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG,
615                 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) );
616
617         // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: </control>
618
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
619             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG,
620                 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) );
621
622         // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: <control>
623
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
624             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG,
625                 Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) );
626
627         // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: </modifyRequest>
628
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "modifyRequest", Tag.END ),
629             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
630                 null ) );
631
632         // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: <modification>
633
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG].put( new Tag( "modification", Tag.START ),
634             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG,
635                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
636
637         // State: [MODIFY_REQUEST_START_TAG] - Tag: <modification>
638
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG].put( new Tag( "modification", Tag.START ),
639             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
640                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
641
642         // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: <modification>
643
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG].put(
644             new Tag( "modification", Tag.START ), new GrammarTransition(
645                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG,
646                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
647
648         // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: </modification>
649
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG].put(
650             new Tag( "modification", Tag.END ), new GrammarTransition(
651                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG,
652                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) );
653
654         // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: <value>
655
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG].put( new Tag( "value", Tag.START ),
656             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG,
657                 Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) );
658
659         // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: <value>
660
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG].put( new Tag( "value", Tag.START ),
661             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG,
662                 Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) );
663
664         // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: </modification>
665
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG].put( new Tag( "modification", Tag.END ),
666             new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG,
667                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) );
668
669         // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: </modifyRequest>
670
super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG].put(
671             new Tag( "modifyRequest", Tag.END ), new GrammarTransition(
672                 Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
673
674         //====================================================
675
// Transitions concerning : SEARCH REQUEST
676
//====================================================
677
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
678         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
679         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
680         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
681         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
682         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
683         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
684         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
685
686         // State: [SEARCH_REQUEST_START_TAG] - Tag: <control>
687
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG].put( new Tag( "control", Tag.START ),
688             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
689                 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) );
690
691         // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
692
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG].put( new Tag( "controlValue", Tag.START ),
693             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG,
694                 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
695
696         // State: [SEARCH_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
697
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG].put( new Tag( "control", Tag.END ),
698             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG,
699                 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) );
700
701         // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: </control>
702
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG].put( new Tag( "control", Tag.END ),
703             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG,
704                 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) );
705
706         // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: <control>
707
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG].put( new Tag( "control", Tag.START ),
708             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG,
709                 Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) );
710
711         // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: </attributes>
712
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG].put( new Tag( "attributes", Tag.END ),
713             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG,
714                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) );
715
716         // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: <attribute>
717
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG].put( new Tag( "attribute", Tag.START ),
718             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG,
719                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) );
720
721         // State: [SEARCH_REQUEST_ATTRIBUTE_START_TAG] - Tag: </attribute>
722
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG].put( new Tag( "attribute", Tag.END ),
723             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG,
724                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, null ) );
725
726         // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: <attribute>
727
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG].put( new Tag( "attribute", Tag.START ),
728             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG,
729                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) );
730
731         // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: </attributes>
732
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG].put( new Tag( "attributes", Tag.END ),
733             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG,
734                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) );
735
736         // State: [SEARCH_REQUEST_ATTRIBUTES_END_TAG] - Tag: </searchRequest>
737
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG].put( new Tag( "searchRequest", Tag.END ),
738             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG,
739                 Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
740
741         //====================================================
742
// Transitions concerning : FILTER
743
//====================================================
744
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
745         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
746         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP] = new HashMap JavaDoc<Tag, GrammarTransition>();
747         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
748         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
749         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
750         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
751         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
752         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
753         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
754         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
755
756         // State: [SEARCH_REQUEST_START_TAG] - Tag: <filter>
757
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG].put( new Tag( "filter", Tag.START ),
758             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
759                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) );
760
761         // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: <filter>
762
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG].put( new Tag( "filter", Tag.START ),
763             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG,
764                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) );
765
766         //*** AND ***
767
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <and>
768
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "and", Tag.START ),
769             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
770                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) );
771
772         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <and>
773
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "and", Tag.START ),
774             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
775                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) );
776
777         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </and>
778
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "and", Tag.END ),
779             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
780                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
781
782         //*** OR ***
783
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <or>
784
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "or", Tag.START ),
785             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
786                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) );
787
788         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <or>
789
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "or", Tag.START ),
790             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
791                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) );
792
793         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </or>
794
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "or", Tag.END ),
795             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
796                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
797
798         //*** NOT ***
799
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <not>
800
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "not", Tag.START ),
801             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
802                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) );
803
804         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <not>
805
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "not", Tag.START ),
806             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
807                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) );
808
809         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </not>
810
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "not", Tag.END ),
811             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
812                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
813
814         //*** SUBSTRINGS ***
815
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <substrings>
816
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "substrings", Tag.START ),
817             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
818                 Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) );
819
820         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <substrings>
821
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "substrings", Tag.START ),
822             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
823                 Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) );
824
825         //*** EQUALITY MATCH ***
826
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <equalityMatch>
827
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "equalityMatch", Tag.START ),
828             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
829                 Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) );
830
831         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <equalityMatch>
832
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "equalityMatch", Tag.START ),
833             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
834                 Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) );
835
836         // State: [SEARCH_REQUEST_EQUALITYMATCH_START_TAG] - Tag: <value>
837
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG].put( new Tag( "value", Tag.START ),
838             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG,
839                 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
840
841         // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </equalityMatch>
842
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "equalityMatch", Tag.END ),
843             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
844                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
845
846         //*** GREATER OR EQUAL ***
847
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <greaterOrEqual>
848
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put(
849             new Tag( "greaterOrEqual", Tag.START ), new GrammarTransition(
850                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
851                 Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) );
852
853         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <greaterOrEqual>
854
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "greaterOrEqual", Tag.START ),
855             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
856                 Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) );
857
858         // State: [SEARCH_REQUEST_GREATEROREQUAL_START_TAG] - Tag: <value>
859
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG].put( new Tag( "value", Tag.START ),
860             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG,
861                 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
862
863         // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </greaterOrEqual>
864
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "greaterOrEqual", Tag.END ),
865             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
866                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
867
868         //*** LESS OR EQUAL ***
869
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <lessOrEqual>
870
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "lessOrEqual", Tag.START ),
871             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
872                 Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) );
873
874         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <lessOrEqual>
875
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "lessOrEqual", Tag.START ),
876             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
877                 Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) );
878
879         // State: [SEARCH_REQUEST_LESSOREQUAL_START_TAG] - Tag: <value>
880
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG].put( new Tag( "value", Tag.START ),
881             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG,
882                 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
883
884         // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </lessOrEqual>
885
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "lessOrEqual", Tag.END ),
886             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
887                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
888
889         //*** LESS OR EQUAL ***
890
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <approxMatch>
891
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "approxMatch", Tag.START ),
892             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
893                 Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) );
894
895         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <approxMatch>
896
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "approxMatch", Tag.START ),
897             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
898                 Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) );
899
900         // State: [SEARCH_REQUEST_APPROXMATCH_START_TAG] - Tag: <value>
901
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG].put( new Tag( "value", Tag.START ),
902             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG,
903                 Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
904
905         // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </approxMatch>
906
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG].put( new Tag( "approxMatch", Tag.END ),
907             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
908                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
909
910         //*** PRESENT ***
911
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <present>
912
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put( new Tag( "present", Tag.START ),
913             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
914                 Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) );
915
916         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <present>
917
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "present", Tag.START ),
918             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
919                 Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) );
920
921         // State: [SEARCH_REQUEST_PRESENT_START_TAG] - Tag: </present>
922
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG].put( new Tag( "present", Tag.END ),
923             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG,
924                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
925
926         //*** EXTENSIBLE MATCH ***
927
// State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <extensibleMatch>
928
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG].put(
929             new Tag( "extensibleMatch", Tag.START ), new GrammarTransition(
930                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
931                 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) );
932
933         // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <extensibleMatch>
934
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "extensibleMatch", Tag.START ),
935             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
936                 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) );
937
938         // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG] - Tag: <value>
939
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG].put(
940             new Tag( "value", Tag.START ), new GrammarTransition(
941                 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG,
942                 Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, extensibleMatchAddValue ) );
943
944         // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG] - Tag: </extensibleMatch>
945
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG].put( new Tag(
946             "extensibleMatch", Tag.END ), new GrammarTransition(
947             Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
948             null ) );
949
950         //*** Filter (end) ***
951
// State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </filter>
952
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP].put( new Tag( "filter", Tag.END ),
953             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
954                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, null ) );
955
956         // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: <attributes>
957
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG].put( new Tag( "attributes", Tag.START ),
958             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG,
959                 Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, null ) );
960
961         // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: </searchRequest>
962
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG].put( new Tag( "searchRequest", Tag.END ),
963             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
964                 null ) );
965
966         //====================================================
967
// Transitions concerning : SUBSTRING FILTER
968
//====================================================
969
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
970         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
971         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
972         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
973         super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_END_TAG] = new HashMap JavaDoc<Tag, GrammarTransition>();
974
975         // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: </substrings>
976
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "substrings", Tag.END ),
977             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
978                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
979
980         // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <initial>
981
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "initial", Tag.START ),
982             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
983                 Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, substringsFilterSetInitial ) );
984
985         // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: <any>
986
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "any", Tag.START ),
987             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
988                 Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
989
990         // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: <final>
991
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "final", Tag.START ),
992             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
993                 Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
994
995         // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: </substrings>
996
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG].put( new Tag( "substrings", Tag.END ),
997             new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
998                 Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
999
1000        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <any>
1001
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "any", Tag.START ),
1002            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
1003                Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
1004
1005        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: </any>
1006
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "any", Tag.START ),
1007            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
1008                Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
1009
1010        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: <final>
1011
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "final", Tag.START ),
1012            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
1013                Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
1014
1015        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: </substrings>
1016
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG].put( new Tag( "substrings", Tag.END ),
1017            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
1018                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
1019
1020        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <final>
1021
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG].put( new Tag( "final", Tag.START ),
1022            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
1023                Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
1024
1025        // State: [SEARCH_REQUEST_FINAL_END_TAG] - Tag: </substrings>
1026
super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG].put( new Tag( "substrings", Tag.END ),
1027            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG,
1028                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
1029
1030    } // End of the constructor
1031

1032    //*************************
1033
//* GRAMMAR ACTIONS *
1034
//*************************
1035

1036    /**
1037     * GrammarAction that creates an Abandon Request
1038     */

1039    private final GrammarAction batchRequestCreation = new GrammarAction( "Create Batch Request" )
1040    {
1041        public void action( Dsmlv2Container container ) throws XmlPullParserException
1042        {
1043            BatchRequest batchRequest = new BatchRequest();
1044
1045            container.setBatchRequest( batchRequest );
1046
1047            XmlPullParser xpp = container.getParser();
1048
1049            // Checking and adding the batchRequest's attributes
1050
String JavaDoc attributeValue;
1051            // requestID
1052
attributeValue = xpp.getAttributeValue( "", "requestID" );
1053            if ( attributeValue != null )
1054            {
1055                batchRequest.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1056            }
1057            // processing
1058
attributeValue = xpp.getAttributeValue( "", "processing" );
1059            if ( attributeValue != null )
1060            {
1061                if ( "sequential".equals( attributeValue ) )
1062                {
1063                    batchRequest.setProcessing( Processing.SEQUENTIAL );
1064                }
1065                else if ( "parallel".equals( attributeValue ) )
1066                {
1067                    batchRequest.setProcessing( Processing.PARALLEL );
1068                }
1069                else
1070                {
1071                    throw new XmlPullParserException( "Unknown value for 'processing' attribute.", xpp, null );
1072                }
1073            }
1074            else
1075            {
1076                batchRequest.setProcessing( Processing.SEQUENTIAL );
1077            }
1078            // onError
1079
attributeValue = xpp.getAttributeValue( "", "onError" );
1080            if ( attributeValue != null )
1081            {
1082                if ( "resume".equals( attributeValue ) )
1083                {
1084                    batchRequest.setOnError( OnError.RESUME );
1085                }
1086                else if ( "exit".equals( attributeValue ) )
1087                {
1088                    batchRequest.setOnError( OnError.EXIT );
1089                }
1090                else
1091                {
1092                    throw new XmlPullParserException( "Unknown value for 'onError' attribute.", xpp, null );
1093                }
1094            }
1095            else
1096            {
1097                batchRequest.setOnError( OnError.EXIT );
1098            }
1099            // responseOrder
1100
attributeValue = xpp.getAttributeValue( "", "responseOrder" );
1101            if ( attributeValue != null )
1102            {
1103                if ( "sequential".equals( attributeValue ) )
1104                {
1105                    batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL );
1106                }
1107                else if ( "unordered".equals( attributeValue ) )
1108                {
1109                    batchRequest.setResponseOrder( ResponseOrder.UNORDERED );
1110                }
1111                else
1112                {
1113                    throw new XmlPullParserException( "Unknown value for 'responseOrder' attribute.", xpp, null );
1114                }
1115            }
1116            else
1117            {
1118                batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL );
1119            }
1120        }
1121    };
1122
1123    /**
1124     * GrammarAction that creates an Abandon Request
1125     */

1126    private final GrammarAction abandonRequestCreation = new GrammarAction( "Create Abandon Request" )
1127    {
1128        public void action( Dsmlv2Container container ) throws XmlPullParserException
1129        {
1130            AbandonRequest abandonRequest = new AbandonRequest();
1131            container.getBatchRequest().addRequest( abandonRequest );
1132
1133            XmlPullParser xpp = container.getParser();
1134
1135            // Checking and adding the request's attributes
1136
String JavaDoc attributeValue;
1137            // requestID
1138
attributeValue = xpp.getAttributeValue( "", "requestID" );
1139            if ( attributeValue != null )
1140            {
1141                abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1142            }
1143            else
1144            {
1145                if ( ParserUtils.isRequestIdNeeded( container ) )
1146                {
1147                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1148                }
1149            }
1150            // abandonID
1151
attributeValue = xpp.getAttributeValue( "", "abandonID" );
1152            if ( attributeValue != null )
1153            {
1154                try
1155                {
1156                    abandonRequest.setAbandonedMessageId( Integer.parseInt( attributeValue ) );
1157                }
1158                catch ( NumberFormatException JavaDoc e )
1159                {
1160                    throw new XmlPullParserException( "the given abandonID is not an integer", xpp, null );
1161                }
1162            }
1163            else
1164            {
1165                throw new XmlPullParserException( "abandonID attribute is required", xpp, null );
1166            }
1167        }
1168    };
1169
1170    /**
1171     * GrammarAction that creates an Add Request
1172     */

1173    private final GrammarAction addRequestCreation = new GrammarAction( "Create Add Request" )
1174    {
1175        public void action( Dsmlv2Container container ) throws XmlPullParserException
1176        {
1177            AddRequest addRequest = new AddRequest();
1178            container.getBatchRequest().addRequest( addRequest );
1179            addRequest.initAttributes(); // TODO maybe delay that to the first attribute discovery
1180

1181            XmlPullParser xpp = container.getParser();
1182
1183            // Checking and adding the request's attributes
1184
String JavaDoc attributeValue;
1185            // requestID
1186
attributeValue = xpp.getAttributeValue( "", "requestID" );
1187            if ( attributeValue != null )
1188            {
1189                addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1190            }
1191            else
1192            {
1193                if ( ParserUtils.isRequestIdNeeded( container ) )
1194                {
1195                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1196                }
1197            }
1198            // dn
1199
attributeValue = xpp.getAttributeValue( "", "dn" );
1200            if ( attributeValue != null )
1201            {
1202                try
1203                {
1204                    addRequest.setEntry( new LdapDN( attributeValue ) );
1205                }
1206                catch ( InvalidNameException JavaDoc e )
1207                {
1208                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1209                }
1210            }
1211            else
1212            {
1213                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1214            }
1215        }
1216    };
1217
1218    /**
1219     * GrammarAction that adds an attribute to an Add Request
1220     */

1221    private final GrammarAction addRequestAddAttribute = new GrammarAction( "Add Attribute to Add Request" )
1222    {
1223        public void action( Dsmlv2Container container ) throws XmlPullParserException
1224        {
1225            AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest();
1226
1227            XmlPullParser xpp = container.getParser();
1228
1229            // Checking and adding the request's attributes
1230
String JavaDoc attributeValue;
1231            // name
1232
attributeValue = xpp.getAttributeValue( "", "name" );
1233            if ( attributeValue != null )
1234            {
1235                addRequest.addAttributeType( attributeValue );
1236            }
1237            else
1238            {
1239                throw new XmlPullParserException( "name attribute is required", xpp, null );
1240            }
1241        }
1242    };
1243
1244    /**
1245     * GrammarAction that adds a Value to an Attribute of an Add Request
1246     */

1247    private final GrammarAction addRequestAddValue = new GrammarAction( "Add Value to Attribute" )
1248    {
1249        public void action( Dsmlv2Container container ) throws XmlPullParserException
1250        {
1251            AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest();
1252
1253            XmlPullParser xpp = container.getParser();
1254            try
1255            {
1256                // We have to catch the type Attribute Value before going to the next Text node
1257
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1258
1259                // Getting the value
1260
String JavaDoc nextText = xpp.nextText();
1261                if ( !nextText.equals( "" ) )
1262                {
1263                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1264                    {
1265                        addRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) );
1266                    }
1267                    else
1268                    {
1269                        addRequest.addAttributeValue( nextText.trim() );
1270                    }
1271                }
1272            }
1273            catch ( IOException JavaDoc e )
1274            {
1275                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
1276            }
1277        }
1278    };
1279
1280    /**
1281     * GrammarAction that creates an Auth Request
1282     */

1283    private final GrammarAction authRequestCreation = new GrammarAction( "Create Auth Request" )
1284    {
1285        public void action( Dsmlv2Container container ) throws XmlPullParserException
1286        {
1287            BindRequest authRequest = new BindRequest();
1288            container.getBatchRequest().addRequest( authRequest );
1289
1290            SimpleAuthentication simpleAuthentication = new SimpleAuthentication();
1291            simpleAuthentication.setSimple( StringTools.EMPTY_BYTES );
1292            authRequest.setAuthentication( simpleAuthentication );
1293            authRequest.setVersion( 3 );
1294
1295            XmlPullParser xpp = container.getParser();
1296
1297            // Checking and adding the request's attributes
1298
String JavaDoc attributeValue;
1299            // requestID
1300
attributeValue = xpp.getAttributeValue( "", "requestID" );
1301            if ( attributeValue != null )
1302            {
1303                authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1304            }
1305            else
1306            {
1307                if ( ParserUtils.isRequestIdNeeded( container ) )
1308                {
1309                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1310                }
1311            }
1312            // principal
1313
attributeValue = xpp.getAttributeValue( "", "principal" );
1314            if ( attributeValue != null )
1315            {
1316                try
1317                {
1318                    authRequest.setName( new LdapDN( attributeValue ) );
1319                }
1320                catch ( InvalidNameException JavaDoc e )
1321                {
1322                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1323                }
1324            }
1325            else
1326            {
1327                throw new XmlPullParserException( "principal attribute is required", xpp, null );
1328            }
1329        }
1330    };
1331
1332    /**
1333     * GrammarAction that creates an Compare Request
1334     */

1335    private final GrammarAction compareRequestCreation = new GrammarAction( "Create Compare Request" )
1336    {
1337        public void action( Dsmlv2Container container ) throws XmlPullParserException
1338        {
1339            CompareRequest compareRequest = new CompareRequest();
1340            container.getBatchRequest().addRequest( compareRequest );
1341
1342            XmlPullParser xpp = container.getParser();
1343
1344            // Checking and adding the request's attributes
1345
String JavaDoc attributeValue;
1346            // requestID
1347
attributeValue = xpp.getAttributeValue( "", "requestID" );
1348            if ( attributeValue != null )
1349            {
1350                compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1351            }
1352            else
1353            {
1354                if ( ParserUtils.isRequestIdNeeded( container ) )
1355                {
1356                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1357                }
1358            }
1359            // dn
1360
attributeValue = xpp.getAttributeValue( "", "dn" );
1361            if ( attributeValue != null )
1362            {
1363                try
1364                {
1365                    compareRequest.setEntry( new LdapDN( attributeValue ) );
1366                }
1367                catch ( InvalidNameException JavaDoc e )
1368                {
1369                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1370                }
1371            }
1372            else
1373            {
1374                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1375            }
1376        }
1377    };
1378
1379    /**
1380     * GrammarAction that adds an Assertion to a Compare Request
1381     */

1382    private final GrammarAction compareRequestAddAssertion = new GrammarAction( "Add Assertion to Compare Request" )
1383    {
1384        public void action( Dsmlv2Container container ) throws XmlPullParserException
1385        {
1386            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
1387
1388            XmlPullParser xpp = container.getParser();
1389
1390            // Checking and adding the request's attributes
1391
String JavaDoc attributeValue;
1392            // name
1393
attributeValue = xpp.getAttributeValue( "", "name" );
1394            if ( attributeValue != null )
1395            {
1396                compareRequest.setAttributeDesc( attributeValue );
1397
1398            }
1399            else
1400            {
1401                throw new XmlPullParserException( "name attribute is required", xpp, null );
1402            }
1403        }
1404    };
1405
1406    /**
1407     * GrammarAction that adds a Value to a Compare Request
1408     */

1409    private final GrammarAction compareRequestAddValue = new GrammarAction( "Add Value to Compare Request" )
1410    {
1411        public void action( Dsmlv2Container container ) throws XmlPullParserException
1412        {
1413            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
1414
1415            XmlPullParser xpp = container.getParser();
1416            try
1417            {
1418                // We have to catch the type Attribute Value before going to the next Text node
1419
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1420
1421                // Getting the value
1422
String JavaDoc nextText = xpp.nextText();
1423                if ( !nextText.equals( "" ) )
1424                {
1425                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1426                    {
1427                        compareRequest.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) );
1428                    }
1429                    else
1430                    {
1431
1432                        compareRequest.setAssertionValue( nextText.trim() );
1433                    }
1434                }
1435            }
1436            catch ( IOException JavaDoc e )
1437            {
1438                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
1439            }
1440        }
1441    };
1442
1443    /**
1444     * GrammarAction that creates a Del Request
1445     */

1446    private final GrammarAction delRequestCreation = new GrammarAction( "Create Del Request" )
1447    {
1448        public void action( Dsmlv2Container container ) throws XmlPullParserException
1449        {
1450            DelRequest delRequest = new DelRequest();
1451            container.getBatchRequest().addRequest( delRequest );
1452
1453            XmlPullParser xpp = container.getParser();
1454
1455            // Checking and adding the request's attributes
1456
String JavaDoc attributeValue;
1457            // requestID
1458
attributeValue = xpp.getAttributeValue( "", "requestID" );
1459            if ( attributeValue != null )
1460            {
1461                delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1462            }
1463            else
1464            {
1465                if ( ParserUtils.isRequestIdNeeded( container ) )
1466                {
1467                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1468                }
1469            }
1470            // dn
1471
attributeValue = xpp.getAttributeValue( "", "dn" );
1472            if ( attributeValue != null )
1473            {
1474                try
1475                {
1476                    delRequest.setEntry( new LdapDN( attributeValue ) );
1477                }
1478                catch ( InvalidNameException JavaDoc e )
1479                {
1480                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1481                }
1482            }
1483            else
1484            {
1485                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1486            }
1487        }
1488    };
1489
1490    /**
1491     * GrammarAction that creates an Extended Request
1492     */

1493    private final GrammarAction extendedRequestCreation = new GrammarAction( "Create Extended Request" )
1494    {
1495        public void action( Dsmlv2Container container ) throws XmlPullParserException
1496        {
1497            ExtendedRequest extendedRequest = new ExtendedRequest();
1498            container.getBatchRequest().addRequest( extendedRequest );
1499
1500            XmlPullParser xpp = container.getParser();
1501
1502            // Checking and adding the request's attributes
1503
String JavaDoc attributeValue;
1504            // requestID
1505
attributeValue = xpp.getAttributeValue( "", "requestID" );
1506            if ( attributeValue != null )
1507            {
1508                extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1509            }
1510            else
1511            {
1512                if ( ParserUtils.isRequestIdNeeded( container ) )
1513                {
1514                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1515                }
1516            }
1517        }
1518    };
1519
1520    /**
1521     * GrammarAction that adds a Name to an Extended Request
1522     */

1523    private final GrammarAction extendedRequestAddName = new GrammarAction( "Add Name to Extended Request" )
1524    {
1525        public void action( Dsmlv2Container container ) throws XmlPullParserException
1526        {
1527            ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest();
1528
1529            XmlPullParser xpp = container.getParser();
1530            try
1531            {
1532                String JavaDoc nextText = xpp.nextText();
1533                if ( nextText.equals( "" ) )
1534                {
1535                    throw new XmlPullParserException( "The request name can't be null", xpp, null );
1536                }
1537                else
1538                {
1539                    extendedRequest.setRequestName( new OID( nextText.trim() ) );
1540                }
1541            }
1542            catch ( IOException JavaDoc e )
1543            {
1544                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
1545            }
1546            catch ( DecoderException e )
1547            {
1548                throw new XmlPullParserException( e.getMessage(), xpp, null );
1549            }
1550        }
1551    };
1552
1553    /**
1554     * GrammarAction that adds a Value to an Extended Request
1555     */

1556    private final GrammarAction extendedRequestAddValue = new GrammarAction( "Add Value to Extended Request" )
1557    {
1558        public void action( Dsmlv2Container container ) throws XmlPullParserException
1559        {
1560            ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest();
1561
1562            XmlPullParser xpp = container.getParser();
1563            try
1564            {
1565                // We have to catch the type Attribute Value before going to the next Text node
1566
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1567
1568                // Getting the value
1569
String JavaDoc nextText = xpp.nextText();
1570                if ( !nextText.equals( "" ) )
1571                {
1572                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1573                    {
1574                        extendedRequest.setRequestValue( Base64.decode( nextText.trim().toCharArray() ) );
1575                    }
1576                    else
1577                    {
1578                        extendedRequest.setRequestValue( nextText.trim().getBytes() );
1579                    }
1580                }
1581            }
1582            catch ( IOException JavaDoc e )
1583            {
1584                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
1585            }
1586        }
1587    };
1588
1589    /**
1590     * GrammarAction that creates a Modify DN Request
1591     */

1592    private final GrammarAction modDNRequestCreation = new GrammarAction( "Create Modify DN Request" )
1593    {
1594        public void action( Dsmlv2Container container ) throws XmlPullParserException
1595        {
1596            ModifyDNRequest modifyDNRequest = new ModifyDNRequest();
1597            container.getBatchRequest().addRequest( modifyDNRequest );
1598
1599            XmlPullParser xpp = container.getParser();
1600
1601            // Checking and adding the request's attributes
1602
String JavaDoc attributeValue;
1603            // requestID
1604
attributeValue = xpp.getAttributeValue( "", "requestID" );
1605            if ( attributeValue != null )
1606            {
1607                modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1608            }
1609            else
1610            {
1611                if ( ParserUtils.isRequestIdNeeded( container ) )
1612                {
1613                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1614                }
1615            }
1616            // dn
1617
attributeValue = xpp.getAttributeValue( "", "dn" );
1618            if ( attributeValue != null )
1619            {
1620                try
1621                {
1622                    modifyDNRequest.setEntry( new LdapDN( attributeValue ) );
1623                }
1624                catch ( InvalidNameException JavaDoc e )
1625                {
1626                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1627                }
1628            }
1629            else
1630            {
1631                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1632            }
1633            // newrdn
1634
attributeValue = xpp.getAttributeValue( "", "newrdn" );
1635            if ( attributeValue != null )
1636            {
1637                try
1638                {
1639                    modifyDNRequest.setNewRDN( new Rdn( attributeValue ) );
1640                }
1641                catch ( InvalidNameException JavaDoc e )
1642                {
1643                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1644                }
1645            }
1646            else
1647            {
1648                throw new XmlPullParserException( "newrdn attribute is required", xpp, null );
1649            }
1650            // deleteoldrdn
1651
attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" );
1652            if ( attributeValue != null )
1653            {
1654                if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
1655                {
1656                    modifyDNRequest.setDeleteOldRDN( true );
1657                }
1658                else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) )
1659                {
1660                    modifyDNRequest.setDeleteOldRDN( false );
1661                }
1662                else
1663                {
1664                    throw new XmlPullParserException( "Incorrect value for 'deleteoldrdn' attribute", xpp, null );
1665                }
1666            }
1667            else
1668            {
1669                modifyDNRequest.setDeleteOldRDN( true );
1670            }
1671            // newsuperior
1672
attributeValue = xpp.getAttributeValue( "", "newSuperior" );
1673            if ( attributeValue != null )
1674            {
1675                try
1676                {
1677                    modifyDNRequest.setNewSuperior( new LdapDN( attributeValue ) );
1678                }
1679                catch ( InvalidNameException JavaDoc e )
1680                {
1681                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1682                }
1683            }
1684        }
1685    };
1686
1687    /**
1688     * GrammarAction that creates a Modify Request
1689     */

1690    private final GrammarAction modifyRequestCreation = new GrammarAction( "Create Modify Request" )
1691    {
1692        public void action( Dsmlv2Container container ) throws XmlPullParserException
1693        {
1694            ModifyRequest modifyRequest = new ModifyRequest();
1695            container.getBatchRequest().addRequest( modifyRequest );
1696
1697            modifyRequest.initModifications();
1698
1699            XmlPullParser xpp = container.getParser();
1700
1701            // Checking and adding the request's attributes
1702
String JavaDoc attributeValue;
1703            // requestID
1704
attributeValue = xpp.getAttributeValue( "", "requestID" );
1705            if ( attributeValue != null )
1706            {
1707                modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1708            }
1709            else
1710            {
1711                if ( ParserUtils.isRequestIdNeeded( container ) )
1712                {
1713                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1714                }
1715            }
1716            // dn
1717
attributeValue = xpp.getAttributeValue( "", "dn" );
1718            if ( attributeValue != null )
1719            {
1720                try
1721                {
1722                    modifyRequest.setObject( new LdapDN( attributeValue ) );
1723                }
1724                catch ( InvalidNameException JavaDoc e )
1725                {
1726                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1727                }
1728            }
1729            else
1730            {
1731                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1732            }
1733        }
1734    };
1735
1736    /**
1737     * GrammarAction that adds a Modification to a Modify Request
1738     */

1739    private final GrammarAction modifyRequestAddModification = new GrammarAction( "Adds Modification to Modify Request" )
1740    {
1741        public void action( Dsmlv2Container container ) throws XmlPullParserException
1742        {
1743            ModifyRequest modifyRequest = ( ModifyRequest ) container.getBatchRequest().getCurrentRequest();
1744
1745            XmlPullParser xpp = container.getParser();
1746
1747            // Checking and adding the request's attributes
1748
String JavaDoc attributeValue;
1749            // operation
1750
attributeValue = xpp.getAttributeValue( "", "operation" );
1751            if ( attributeValue != null )
1752            {
1753                if ( "add".equals( attributeValue ) )
1754                {
1755                    modifyRequest.setCurrentOperation( LdapConstants.OPERATION_ADD );
1756                }
1757                else if ( "delete".equals( attributeValue ) )
1758                {
1759                    modifyRequest.setCurrentOperation( LdapConstants.OPERATION_DELETE );
1760                }
1761                else if ( "replace".equals( attributeValue ) )
1762                {
1763                    modifyRequest.setCurrentOperation( LdapConstants.OPERATION_REPLACE );
1764                }
1765                else
1766                {
1767                    throw new XmlPullParserException(
1768                        "unknown operation. Operation can be 'add', 'delete' or 'replace'.", xpp, null );
1769                }
1770            }
1771            else
1772            {
1773                throw new XmlPullParserException( "operation attribute is required", xpp, null );
1774            }
1775            // name
1776
attributeValue = xpp.getAttributeValue( "", "name" );
1777            if ( attributeValue != null )
1778            {
1779                modifyRequest.addAttributeTypeAndValues( attributeValue );
1780            }
1781            else
1782            {
1783                throw new XmlPullParserException( "name attribute is required", xpp, null );
1784            }
1785        }
1786    };
1787
1788    /**
1789     * GrammarAction that adds a Value to a Modification of a Modify Request
1790     */

1791    private final GrammarAction modifyRequestAddValue = new GrammarAction(
1792        "Add Value to Modification of Modify Request" )
1793    {
1794        public void action( Dsmlv2Container container ) throws XmlPullParserException
1795        {
1796            ModifyRequest modifyRequest = ( ModifyRequest ) container.getBatchRequest().getCurrentRequest();
1797
1798            XmlPullParser xpp = container.getParser();
1799            try
1800            {
1801                // We have to catch the type Attribute Value before going to the next Text node
1802
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1803
1804                // Getting the value
1805
String JavaDoc nextText = xpp.nextText();
1806                // We are testing if nextText equals "" since a modification can be "".
1807

1808                if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1809                {
1810                    modifyRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) );
1811                }
1812                else
1813                {
1814                    modifyRequest.addAttributeValue( nextText.trim() );
1815                }
1816            }
1817            catch ( IOException JavaDoc e )
1818            {
1819                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
1820            }
1821        }
1822    };
1823
1824    /**
1825     * GrammarAction that creates a Search Request
1826     */

1827    private final GrammarAction searchRequestCreation = new GrammarAction( "Create Search Request" )
1828    {
1829        public void action( Dsmlv2Container container ) throws XmlPullParserException
1830        {
1831            SearchRequest searchRequest = new SearchRequest();
1832            container.getBatchRequest().addRequest( searchRequest );
1833
1834            XmlPullParser xpp = container.getParser();
1835
1836            // Checking and adding the request's attributes
1837
String JavaDoc attributeValue;
1838            // requestID
1839
attributeValue = xpp.getAttributeValue( "", "requestID" );
1840            if ( attributeValue != null )
1841            {
1842                searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1843            }
1844            else
1845            {
1846                if ( ParserUtils.isRequestIdNeeded( container ) )
1847                {
1848                    throw new XmlPullParserException( "requestID attribute is required", xpp, null );
1849                }
1850            }
1851            // dn
1852
attributeValue = xpp.getAttributeValue( "", "dn" );
1853            if ( attributeValue != null )
1854            {
1855                try
1856                {
1857                    searchRequest.setBaseObject( new LdapDN( attributeValue ) );
1858                }
1859                catch ( InvalidNameException JavaDoc e )
1860                {
1861                    throw new XmlPullParserException( "" + e.getMessage(), xpp, null );
1862                }
1863            }
1864            else
1865            {
1866                throw new XmlPullParserException( "dn attribute is required", xpp, null );
1867            }
1868            // scope
1869
attributeValue = xpp.getAttributeValue( "", "scope" );
1870            if ( attributeValue != null )
1871            {
1872                if ( "baseObject".equals( attributeValue ) )
1873                {
1874                    searchRequest.setScope( ScopeEnum.BASE_OBJECT );
1875                }
1876                else if ( "singleLevel".equals( attributeValue ) )
1877                {
1878                    searchRequest.setScope( ScopeEnum.SINGLE_LEVEL );
1879                }
1880                else if ( "wholeSubtree".equals( attributeValue ) )
1881                {
1882                    searchRequest.setScope( ScopeEnum.WHOLE_SUBTREE );
1883                }
1884                else
1885                {
1886                    throw new XmlPullParserException(
1887                        "unknown scope. Scope must be 'baseObject', 'singleLevel' or 'wholeSubtree'.", xpp, null );
1888                }
1889            }
1890            else
1891            {
1892                throw new XmlPullParserException( "scope attribute is required", xpp, null );
1893            }
1894            // derefAliases
1895
attributeValue = xpp.getAttributeValue( "", "derefAliases" );
1896            if ( attributeValue != null )
1897            {
1898                if ( "neverDerefAliases".equals( attributeValue ) )
1899                {
1900                    searchRequest.setDerefAliases( LdapConstants.NEVER_DEREF_ALIASES );
1901                }
1902                else if ( "derefInSearching".equals( attributeValue ) )
1903                {
1904                    searchRequest.setDerefAliases( LdapConstants.DEREF_IN_SEARCHING );
1905                }
1906                else if ( "derefFindingBaseObj".equals( attributeValue ) )
1907                {
1908                    searchRequest.setDerefAliases( LdapConstants.DEREF_FINDING_BASE_OBJ );
1909                }
1910                else if ( "derefAlways".equals( attributeValue ) )
1911                {
1912                    searchRequest.setDerefAliases( LdapConstants.DEREF_ALWAYS );
1913                }
1914                else
1915                {
1916                    throw new XmlPullParserException(
1917                        "unknown derefAliases value. derefAliases must be 'neverDerefAliases', 'derefInSearching', 'derefFindingBaseObj' or 'derefAlways'.",
1918                        xpp, null );
1919                }
1920            }
1921            else
1922            {
1923                throw new XmlPullParserException( "derefAliases attribute is required", xpp, null );
1924            }
1925            // sizeLimit
1926
attributeValue = xpp.getAttributeValue( "", "sizeLimit" );
1927            if ( attributeValue != null )
1928            {
1929                try
1930                {
1931                    searchRequest.setSizeLimit( Integer.parseInt( attributeValue ) );
1932                }
1933                catch ( NumberFormatException JavaDoc e )
1934                {
1935                    throw new XmlPullParserException( "the given sizeLimit is not an integer", xpp, null );
1936                }
1937            }
1938            else
1939            {
1940                searchRequest.setSizeLimit( 0 );
1941            }
1942            // timeLimit
1943
attributeValue = xpp.getAttributeValue( "", "timeLimit" );
1944            if ( attributeValue != null )
1945            {
1946                try
1947                {
1948                    searchRequest.setTimeLimit( Integer.parseInt( attributeValue ) );
1949                }
1950                catch ( NumberFormatException JavaDoc e )
1951                {
1952                    throw new XmlPullParserException( "the given timeLimit is not an integer", xpp, null );
1953                }
1954            }
1955            else
1956            {
1957                searchRequest.setTimeLimit( 0 );
1958            }
1959            // typesOnly
1960
attributeValue = xpp.getAttributeValue( "", "typesOnly" );
1961            if ( attributeValue != null )
1962            {
1963                if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
1964                {
1965                    searchRequest.setTypesOnly( true );
1966                }
1967                else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) )
1968                {
1969                    searchRequest.setTypesOnly( false );
1970                }
1971                else
1972                {
1973                    throw new XmlPullParserException( "typesOnly must be a boolean ('true' or 'false').", xpp, null );
1974                }
1975            }
1976            else
1977            {
1978                searchRequest.setTypesOnly( false );
1979            }
1980        }
1981    };
1982
1983    /**
1984     * GrammarAction that adds an Attribute to a Search Request
1985     */

1986    private final GrammarAction searchRequestAddAttribute = new GrammarAction(
1987        "Add Value to Modification of Modify Request" )
1988    {
1989        public void action( Dsmlv2Container container ) throws XmlPullParserException
1990        {
1991            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
1992
1993            XmlPullParser xpp = container.getParser();
1994
1995            // Checking and adding the request's attributes
1996
String JavaDoc attributeValue;
1997            // name
1998
attributeValue = xpp.getAttributeValue( "", "name" );
1999            if ( attributeValue != null )
2000            {
2001                searchRequest.addAttribute( attributeValue );
2002            }
2003            else
2004            {
2005                throw new XmlPullParserException( "name attribute is required", xpp, null );
2006            }
2007        }
2008    };
2009
2010    /**
2011     * GrammarAction that create a Substring Filter
2012     */

2013    private final GrammarAction substringsFilterCreation = new GrammarAction( "Create Substring Filter" )
2014    {
2015        public void action( Dsmlv2Container container ) throws XmlPullParserException
2016        {
2017            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2018
2019            XmlPullParser xpp = container.getParser();
2020
2021            SubstringFilter filter = new SubstringFilter();
2022
2023            // Adding the filter to the Search Filter
2024
try
2025            {
2026                searchRequest.addCurrentFilter( filter );
2027            }
2028            catch ( DecoderException e )
2029            {
2030                throw new XmlPullParserException( e.getMessage(), xpp, null );
2031            }
2032            searchRequest.setTerminalFilter( filter );
2033
2034            // Checking and adding the filter's attributes
2035
String JavaDoc attributeValue;
2036            // name
2037
attributeValue = xpp.getAttributeValue( "", "name" );
2038            if ( attributeValue != null )
2039            {
2040                filter.setType( attributeValue );
2041            }
2042            else
2043            {
2044                throw new XmlPullParserException( "name attribute is required", xpp, null );
2045            }
2046        }
2047    };
2048
2049    /**
2050     * GrammarAction that sets the Initial value to a Substring Filter
2051     */

2052    private final GrammarAction substringsFilterSetInitial = new GrammarAction( "Set Initial value to Substring Filter" )
2053    {
2054        public void action( Dsmlv2Container container ) throws XmlPullParserException
2055        {
2056            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2057            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
2058
2059            XmlPullParser xpp = container.getParser();
2060            try
2061            {
2062                // We have to catch the type Attribute Value before going to the next Text node
2063
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2064
2065                // Getting the value
2066
String JavaDoc nextText = xpp.nextText();
2067                if ( !nextText.equals( "" ) )
2068                {
2069                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2070                    {
2071                        substringFilter
2072                            .setInitialSubstrings( new String JavaDoc( Base64.decode( nextText.trim().toCharArray() ) ) );
2073                    }
2074                    else
2075                    {
2076                        substringFilter.setInitialSubstrings( nextText.trim() );
2077                    }
2078                }
2079            }
2080            catch ( IOException JavaDoc e )
2081            {
2082                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2083            }
2084        }
2085    };
2086
2087    /**
2088     * GrammarAction that adds a Any value to a Substring Filter
2089     */

2090    private final GrammarAction substringsFilterAddAny = new GrammarAction( "Add Any value to Substring Filter" )
2091    {
2092        public void action( Dsmlv2Container container ) throws XmlPullParserException
2093        {
2094            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2095            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
2096
2097            XmlPullParser xpp = container.getParser();
2098            try
2099            {
2100                // We have to catch the type Attribute Value before going to the next Text node
2101
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2102
2103                // Getting the value
2104
String JavaDoc nextText = xpp.nextText();
2105                if ( !nextText.equals( "" ) )
2106                {
2107                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2108                    {
2109                        substringFilter.addAnySubstrings( new String JavaDoc( Base64.decode( nextText.trim().toCharArray() ) ) );
2110                    }
2111                    else
2112                    {
2113                        substringFilter.addAnySubstrings( nextText.trim() );
2114                    }
2115                }
2116            }
2117            catch ( IOException JavaDoc e )
2118            {
2119                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2120            }
2121        }
2122    };
2123
2124    /**
2125     * GrammarAction that sets the Final value to a Substring Filter
2126     */

2127    private final GrammarAction substringsFilterSetFinal = new GrammarAction( "Set Final value to Substring Filter" )
2128    {
2129        public void action( Dsmlv2Container container ) throws XmlPullParserException
2130        {
2131            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2132            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
2133
2134            XmlPullParser xpp = container.getParser();
2135            try
2136            {
2137                // We have to catch the type Attribute Value before going to the next Text node
2138
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2139
2140                // Getting the value
2141
String JavaDoc nextText = xpp.nextText();
2142                if ( !nextText.equals( "" ) )
2143                {
2144                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2145                    {
2146                        substringFilter
2147                            .setFinalSubstrings( new String JavaDoc( Base64.decode( nextText.trim().toCharArray() ) ) );
2148                    }
2149                    else
2150                    {
2151                        substringFilter.setFinalSubstrings( nextText.trim() );
2152                    }
2153                }
2154            }
2155            catch ( IOException JavaDoc e )
2156            {
2157                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2158            }
2159        }
2160    };
2161
2162    /**
2163     * GrammarAction that closes a Substring Filter
2164     */

2165    private final GrammarAction substringsFilterClose = new GrammarAction( "Close Substring Filter" )
2166    {
2167        public void action( Dsmlv2Container container ) throws XmlPullParserException
2168        {
2169            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2170
2171            searchRequest.setTerminalFilter( null );
2172        }
2173    };
2174
2175    /**
2176     * GrammarAction that create a And Filter
2177     */

2178    private final GrammarAction andFilterCreation = new GrammarAction( "Create And Filter" )
2179    {
2180        public void action( Dsmlv2Container container ) throws XmlPullParserException
2181        {
2182            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2183
2184            XmlPullParser xpp = container.getParser();
2185
2186            AndFilter filter = new AndFilter();
2187
2188            // Adding the filter to the Search Filter
2189
try
2190            {
2191                searchRequest.addCurrentFilter( filter );
2192            }
2193            catch ( DecoderException e )
2194            {
2195                throw new XmlPullParserException( e.getMessage(), xpp, null );
2196            }
2197        }
2198    };
2199
2200    /**
2201     * GrammarAction that closes a Connector Filter (And, Or, Not)
2202     */

2203    private final GrammarAction connectorFilterClose = new GrammarAction( "Close Connector Filter" )
2204    {
2205        public void action( Dsmlv2Container container ) throws XmlPullParserException
2206        {
2207            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2208
2209            Asn1Object parent = searchRequest.getCurrentFilter().getParent();
2210
2211            if ( parent instanceof Filter )
2212            {
2213                Filter filter = ( Filter ) parent;
2214
2215                searchRequest.setCurrentFilter( filter );
2216            }
2217            else
2218            {
2219                searchRequest.setCurrentFilter( null );
2220            }
2221
2222        }
2223    };
2224
2225    /**
2226     * GrammarAction that create a Or Filter
2227     */

2228    private final GrammarAction orFilterCreation = new GrammarAction( "Create Or Filter" )
2229    {
2230        public void action( Dsmlv2Container container ) throws XmlPullParserException
2231        {
2232            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2233
2234            XmlPullParser xpp = container.getParser();
2235
2236            OrFilter filter = new OrFilter();
2237
2238            // Adding the filter to the Search Filter
2239
try
2240            {
2241                searchRequest.addCurrentFilter( filter );
2242            }
2243            catch ( DecoderException e )
2244            {
2245                throw new XmlPullParserException( e.getMessage(), xpp, null );
2246            }
2247        }
2248    };
2249
2250    /**
2251     * GrammarAction that create a Not Filter
2252     */

2253    private final GrammarAction notFilterCreation = new GrammarAction( "Create Not Filter" )
2254    {
2255        public void action( Dsmlv2Container container ) throws XmlPullParserException
2256        {
2257            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2258
2259            XmlPullParser xpp = container.getParser();
2260
2261            NotFilter filter = new NotFilter();
2262
2263            // Adding the filter to the Search Filter
2264
try
2265            {
2266                searchRequest.addCurrentFilter( filter );
2267            }
2268            catch ( DecoderException e )
2269            {
2270                throw new XmlPullParserException( e.getMessage(), xpp, null );
2271            }
2272        }
2273    };
2274
2275    /**
2276     * GrammarAction that create a Equality Match Filter
2277     */

2278    private final GrammarAction equalityMatchFilterCreation = new GrammarAction( "Create Equality Match Filter" )
2279    {
2280        public void action( Dsmlv2Container container ) throws XmlPullParserException
2281        {
2282            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2283
2284            XmlPullParser xpp = container.getParser();
2285
2286            AttributeValueAssertion assertion = new AttributeValueAssertion();
2287
2288            // Checking and adding the filter's attributes
2289
String JavaDoc attributeValue;
2290            // name
2291
attributeValue = xpp.getAttributeValue( "", "name" );
2292            if ( attributeValue != null )
2293            {
2294                assertion.setAttributeDesc( new String JavaDoc( attributeValue.getBytes() ) );
2295            }
2296            else
2297            {
2298                throw new XmlPullParserException( "name attribute is required", xpp, null );
2299            }
2300
2301            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
2302                LdapConstants.EQUALITY_MATCH_FILTER );
2303
2304            filter.setAssertion( assertion );
2305
2306            // Adding the filter to the Search Filter
2307
try
2308            {
2309                searchRequest.addCurrentFilter( filter );
2310            }
2311            catch ( DecoderException e )
2312            {
2313                throw new XmlPullParserException( e.getMessage(), xpp, null );
2314            }
2315            searchRequest.setTerminalFilter( filter );
2316        }
2317    };
2318
2319    /**
2320     * GrammarAction that create a Greater Or Equal Filter
2321     */

2322    private final GrammarAction greaterOrEqualFilterCreation = new GrammarAction( "Create Greater Or Equal Filter" )
2323    {
2324        public void action( Dsmlv2Container container ) throws XmlPullParserException
2325        {
2326            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2327
2328            XmlPullParser xpp = container.getParser();
2329
2330            AttributeValueAssertion assertion = new AttributeValueAssertion();
2331
2332            // Checking and adding the filter's attributes
2333
String JavaDoc attributeValue;
2334            // name
2335
attributeValue = xpp.getAttributeValue( "", "name" );
2336            if ( attributeValue != null )
2337            {
2338                assertion.setAttributeDesc( new String JavaDoc( attributeValue.getBytes() ) );
2339            }
2340            else
2341            {
2342                throw new XmlPullParserException( "name attribute is required", xpp, null );
2343            }
2344
2345            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
2346                LdapConstants.GREATER_OR_EQUAL_FILTER );
2347
2348            filter.setAssertion( assertion );
2349
2350            // Adding the filter to the Search Filter
2351
try
2352            {
2353                searchRequest.addCurrentFilter( filter );
2354            }
2355            catch ( DecoderException e )
2356            {
2357                throw new XmlPullParserException( e.getMessage(), xpp, null );
2358            }
2359            searchRequest.setTerminalFilter( filter );
2360        }
2361    };
2362
2363    /**
2364     * GrammarAction that create a Less Or Equal Filter
2365     */

2366    private final GrammarAction lessOrEqualFilterCreation = new GrammarAction( "Create Less Or Equal Filter" )
2367    {
2368        public void action( Dsmlv2Container container ) throws XmlPullParserException
2369        {
2370            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2371
2372            XmlPullParser xpp = container.getParser();
2373
2374            AttributeValueAssertion assertion = new AttributeValueAssertion();
2375
2376            // Checking and adding the filter's attributes
2377
String JavaDoc attributeValue;
2378            // name
2379
attributeValue = xpp.getAttributeValue( "", "name" );
2380            if ( attributeValue != null )
2381            {
2382                assertion.setAttributeDesc( new String JavaDoc( attributeValue.getBytes() ) );
2383            }
2384            else
2385            {
2386                throw new XmlPullParserException( "name attribute is required", xpp, null );
2387            }
2388
2389            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
2390                LdapConstants.LESS_OR_EQUAL_FILTER );
2391
2392            filter.setAssertion( assertion );
2393
2394            // Adding the filter to the Search Filter
2395
try
2396            {
2397                searchRequest.addCurrentFilter( filter );
2398            }
2399            catch ( DecoderException e )
2400            {
2401                throw new XmlPullParserException( e.getMessage(), xpp, null );
2402            }
2403            searchRequest.setTerminalFilter( filter );
2404        }
2405    };
2406
2407    /**
2408     * GrammarAction that create an Approx Match Filter
2409     */

2410    private final GrammarAction approxMatchFilterCreation = new GrammarAction( "Create Approx Match Filter" )
2411    {
2412        public void action( Dsmlv2Container container ) throws XmlPullParserException
2413        {
2414            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2415
2416            XmlPullParser xpp = container.getParser();
2417
2418            AttributeValueAssertion assertion = new AttributeValueAssertion();
2419
2420            // Checking and adding the filter's attributes
2421
String JavaDoc attributeValue;
2422            // name
2423
attributeValue = xpp.getAttributeValue( "", "name" );
2424            if ( attributeValue != null )
2425            {
2426                assertion.setAttributeDesc( new String JavaDoc( attributeValue.getBytes() ) );
2427            }
2428            else
2429            {
2430                throw new XmlPullParserException( "name attribute is required", xpp, null );
2431            }
2432
2433            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter( LdapConstants.APPROX_MATCH_FILTER );
2434
2435            filter.setAssertion( assertion );
2436
2437            // Adding the filter to the Search Filter
2438
try
2439            {
2440                searchRequest.addCurrentFilter( filter );
2441            }
2442            catch ( DecoderException e )
2443            {
2444                throw new XmlPullParserException( e.getMessage(), xpp, null );
2445            }
2446
2447            searchRequest.setTerminalFilter( filter );
2448        }
2449    };
2450
2451    /**
2452     * GrammarAction that adds a Value to a Filter
2453     */

2454    private final GrammarAction filterAddValue = new GrammarAction( "Adds Value to Filter" )
2455    {
2456        public void action( Dsmlv2Container container ) throws XmlPullParserException
2457        {
2458            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2459            AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequest.getTerminalFilter();
2460            AttributeValueAssertion assertion = filter.getAssertion();
2461
2462            XmlPullParser xpp = container.getParser();
2463            try
2464            {
2465                // We have to catch the type Attribute Value before going to the next Text node
2466
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2467
2468                // Getting the value
2469
String JavaDoc nextText = xpp.nextText();
2470                if ( !nextText.equals( "" ) )
2471                {
2472                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2473                    {
2474                        assertion.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) );
2475                    }
2476                    else
2477                    {
2478                        assertion.setAssertionValue( nextText.trim() );
2479                    }
2480                }
2481            }
2482            catch ( IOException JavaDoc e )
2483            {
2484                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2485            }
2486        }
2487    };
2488
2489    /**
2490     * GrammarAction that creates a Present Filter
2491     */

2492    private final GrammarAction presentFilterCreation = new GrammarAction( "Create Present Filter" )
2493    {
2494        public void action( Dsmlv2Container container ) throws XmlPullParserException
2495        {
2496            PresentFilter presentFilter = new PresentFilter();
2497
2498            XmlPullParser xpp = container.getParser();
2499
2500            // Adding the filter to the Search Filter
2501
SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2502            try
2503            {
2504                searchRequest.addCurrentFilter( presentFilter );
2505            }
2506            catch ( DecoderException e )
2507            {
2508                throw new XmlPullParserException( e.getMessage(), xpp, null );
2509            }
2510
2511            // Checking and adding the filter's attributes
2512
String JavaDoc attributeValue;
2513            // name
2514
attributeValue = xpp.getAttributeValue( "", "name" );
2515            if ( attributeValue != null )
2516            {
2517                presentFilter.setAttributeDescription( new String JavaDoc( attributeValue.getBytes() ) );
2518            }
2519            else
2520            {
2521                throw new XmlPullParserException( "name attribute is required", xpp, null );
2522            }
2523        }
2524    };
2525
2526    /**
2527     * GrammarAction that creates an Extensible Match Filter
2528     */

2529    private final GrammarAction extensibleMatchFilterCreation = new GrammarAction( "Create Extensible Match Filter" )
2530    {
2531        public void action( Dsmlv2Container container ) throws XmlPullParserException
2532        {
2533            ExtensibleMatchFilter extensibleMatchFilter = new ExtensibleMatchFilter();
2534
2535            XmlPullParser xpp = container.getParser();
2536
2537            // Adding the filter to the Search Filter
2538
SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2539            try
2540            {
2541                searchRequest.addCurrentFilter( extensibleMatchFilter );
2542            }
2543            catch ( DecoderException e )
2544            {
2545                throw new XmlPullParserException( "name attribute is required", xpp, null );
2546            }
2547            searchRequest.setTerminalFilter( extensibleMatchFilter );
2548
2549            // Checking and adding the filter's attributes
2550
String JavaDoc attributeValue;
2551            // dnAttributes
2552
attributeValue = xpp.getAttributeValue( "", "dnAttributes" );
2553            if ( attributeValue != null )
2554            {
2555                if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
2556                {
2557                    extensibleMatchFilter.setDnAttributes( true );
2558                }
2559                else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) )
2560                {
2561                    extensibleMatchFilter.setDnAttributes( false );
2562                }
2563                else
2564                {
2565                    throw new XmlPullParserException( "dnAttributes must be a boolean ('true' or 'false').", xpp, null );
2566                }
2567            }
2568            else
2569            {
2570                extensibleMatchFilter.setDnAttributes( false );
2571            }
2572            // matchingRule
2573
attributeValue = xpp.getAttributeValue( "", "matchingRule" );
2574            if ( attributeValue != null )
2575            {
2576                extensibleMatchFilter.setMatchingRule( attributeValue );
2577            }
2578            // name
2579
attributeValue = xpp.getAttributeValue( "", "name" );
2580            if ( attributeValue != null )
2581            {
2582                extensibleMatchFilter.setType( attributeValue );
2583            }
2584        }
2585    };
2586
2587    /**
2588     * GrammarAction that adds a Value to an Extensible Match Filter
2589     */

2590    private final GrammarAction extensibleMatchAddValue = new GrammarAction( "Adds Value to Extensible MatchFilter" )
2591    {
2592        public void action( Dsmlv2Container container ) throws XmlPullParserException
2593        {
2594            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
2595            ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
2596
2597            XmlPullParser xpp = container.getParser();
2598            try
2599            {
2600                // We have to catch the type Attribute Value before going to the next Text node
2601
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2602
2603                // Getting the value
2604
String JavaDoc nextText = xpp.nextText();
2605                if ( !nextText.equals( "" ) )
2606                {
2607                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2608                    {
2609                        filter.setMatchValue( Base64.decode( nextText.trim().toCharArray() ) );
2610                    }
2611                    else
2612                    {
2613                        filter.setMatchValue( nextText.trim() );
2614                    }
2615                }
2616            }
2617            catch ( IOException JavaDoc e )
2618            {
2619                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2620            }
2621        }
2622    };
2623
2624    /**
2625     * GrammarAction that creates a Control
2626     */

2627    private final GrammarAction controlCreation = new GrammarAction( "Create Control" )
2628    {
2629        public void action( Dsmlv2Container container ) throws XmlPullParserException
2630        {
2631            Control control = new Control();
2632            container.getBatchRequest().getCurrentRequest().addControl( control );
2633
2634            XmlPullParser xpp = container.getParser();
2635
2636            // Checking and adding the Control's attributes
2637
String JavaDoc attributeValue;
2638            // TYPE
2639
attributeValue = xpp.getAttributeValue( "", "type" );
2640            if ( attributeValue != null )
2641            {
2642                if ( !OID.isOID( attributeValue ) )
2643                {
2644                    throw new XmlPullParserException( "Incorrect value for 'type' attribute. This is not an OID.", xpp,
2645                        null );
2646                }
2647                control.setControlType( attributeValue );
2648            }
2649            else
2650            {
2651                throw new XmlPullParserException( "type attribute is required", xpp, null );
2652            }
2653            // CRITICALITY
2654
attributeValue = xpp.getAttributeValue( "", "criticality" );
2655            if ( attributeValue != null )
2656            {
2657                if ( attributeValue.equals( "true" ) )
2658                {
2659                    control.setCriticality( true );
2660                }
2661                else if ( attributeValue.equals( "false" ) )
2662                {
2663                    control.setCriticality( false );
2664                }
2665                else
2666                {
2667                    throw new XmlPullParserException( "Incorrect value for 'criticality' attribute", xpp, null );
2668                }
2669            }
2670        }
2671    };
2672
2673    /**
2674     * GrammarAction that adds a Value to a Control
2675     */

2676    private final GrammarAction controlValueCreation = new GrammarAction( "Add ControlValue to Control" )
2677    {
2678        public void action( Dsmlv2Container container ) throws XmlPullParserException
2679        {
2680            Control control = container.getBatchRequest().getCurrentRequest().getCurrentControl();
2681
2682            XmlPullParser xpp = container.getParser();
2683            try
2684            {
2685                // We have to catch the type Attribute Value before going to the next Text node
2686
String JavaDoc typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2687
2688                // Getting the value
2689
String JavaDoc nextText = xpp.nextText();
2690                if ( !nextText.equals( "" ) )
2691                {
2692                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2693                    {
2694                        control.setControlValue( Base64.decode( nextText.trim().toCharArray() ) );
2695                    }
2696                    else
2697                    {
2698                        control.setControlValue( nextText.trim() );
2699                    }
2700                }
2701            }
2702            catch ( IOException JavaDoc e )
2703            {
2704                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
2705            }
2706        }
2707    };
2708
2709
2710    /**
2711     * Gets an instance of this grammar
2712     *
2713     * @return
2714     * an instance of this grammar
2715     */

2716    public static Dsmlv2Grammar getInstance()
2717    {
2718        return instance;
2719    }
2720}
2721
Popular Tags