001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *    https://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 *
019 */
020
021package org.apache.directory.api.dsmlv2.request;
022
023
024import java.io.IOException;
025import java.lang.reflect.Array;
026import java.util.HashMap;
027
028import org.apache.directory.api.asn1.DecoderException;
029import org.apache.directory.api.asn1.util.Oid;
030import org.apache.directory.api.dsmlv2.AbstractGrammar;
031import org.apache.directory.api.dsmlv2.DsmlControl;
032import org.apache.directory.api.dsmlv2.Dsmlv2Container;
033import org.apache.directory.api.dsmlv2.Dsmlv2StatesEnum;
034import org.apache.directory.api.dsmlv2.Grammar;
035import org.apache.directory.api.dsmlv2.GrammarAction;
036import org.apache.directory.api.dsmlv2.GrammarTransition;
037import org.apache.directory.api.dsmlv2.ParserUtils;
038import org.apache.directory.api.dsmlv2.Tag;
039import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.OnError;
040import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.Processing;
041import org.apache.directory.api.dsmlv2.request.BatchRequestDsml.ResponseOrder;
042import org.apache.directory.api.i18n.I18n;
043import org.apache.directory.api.ldap.codec.api.ControlFactory;
044import org.apache.directory.api.ldap.codec.api.LdapApiService;
045import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
046import org.apache.directory.api.ldap.codec.api.LdapCodecConstants;
047import org.apache.directory.api.ldap.model.entry.Value;
048import org.apache.directory.api.ldap.model.exception.LdapException;
049import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
050import org.apache.directory.api.ldap.model.exception.LdapSchemaException;
051import org.apache.directory.api.ldap.model.filter.ExprNode;
052import org.apache.directory.api.ldap.model.message.AbandonRequestImpl;
053import org.apache.directory.api.ldap.model.message.AddRequestImpl;
054import org.apache.directory.api.ldap.model.message.AliasDerefMode;
055import org.apache.directory.api.ldap.model.message.BindRequestImpl;
056import org.apache.directory.api.ldap.model.message.CompareRequest;
057import org.apache.directory.api.ldap.model.message.CompareRequestImpl;
058import org.apache.directory.api.ldap.model.message.Control;
059import org.apache.directory.api.ldap.model.message.DeleteRequestImpl;
060import org.apache.directory.api.ldap.model.message.OpaqueExtendedRequest;
061import org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl;
062import org.apache.directory.api.ldap.model.message.ModifyRequestImpl;
063import org.apache.directory.api.ldap.model.message.Request;
064import org.apache.directory.api.ldap.model.message.SearchRequest;
065import org.apache.directory.api.ldap.model.message.SearchRequestImpl;
066import org.apache.directory.api.ldap.model.message.SearchScope;
067import org.apache.directory.api.ldap.model.message.controls.OpaqueControl;
068import org.apache.directory.api.ldap.model.name.Dn;
069import org.apache.directory.api.ldap.model.name.Rdn;
070import org.apache.directory.api.util.Base64;
071import org.apache.directory.api.util.Strings;
072import org.xmlpull.v1.XmlPullParser;
073import org.xmlpull.v1.XmlPullParserException;
074
075
076/**
077 * This Class represents the DSMLv2 Request Grammar
078 *
079 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
080 */
081public final class Dsmlv2Grammar extends AbstractGrammar implements Grammar
082{
083    private LdapApiService codec = LdapApiServiceFactory.getSingleton();
084
085    /** Some literal */
086    private static final String BATCH_REQUEST = "batchRequest";
087    private static final String ABANDON_REQUEST = "abandonRequest";
088    private static final String ADD_REQUEST = "addRequest";
089    private static final String COMPARE_REQUEST = "compareRequest";
090    private static final String DEL_REQUEST = "delRequest";
091    private static final String EXTENDED_REQUEST = "extendedRequest";
092    private static final String MOD_DN_REQUEST = "modDNRequest";
093    private static final String MODIFY_REQUEST = "modifyRequest";
094    private static final String SEARCH_REQUEST = "searchRequest";
095    private static final String CONTROL = "control";
096    private static final String CONTROL_VALUE = "controlValue";
097    private static final String ATTR = "attr";
098    private static final String VALUE = "value";
099    private static final String MODIFICATION = "modification";
100    private static final String SUBSTRINGS = "substrings";
101    private static final String REQUEST_ID = "requestID";
102    private static final String NAME = "name";
103    private static final String TRUE = "true";
104    private static final String FALSE = "false";
105    //*************************
106    //*    GRAMMAR ACTIONS    *
107    //*************************
108
109    /**
110     * GrammarAction that creates a Batch Request
111     */
112    private final GrammarAction batchRequestCreation = new GrammarAction( "Create Batch Request" )
113    {
114        /**
115         * {@inheritDoc}
116         */
117        @Override
118        public void action( Dsmlv2Container container ) throws XmlPullParserException
119        {
120            BatchRequestDsml batchRequest = new BatchRequestDsml();
121
122            container.setBatchRequest( batchRequest );
123
124            XmlPullParser xpp = container.getParser();
125
126            // Checking and adding the batchRequest's attributes
127            String attributeValue;
128            // requestID
129            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
130
131            if ( attributeValue != null )
132            {
133                batchRequest.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
134            }
135            // processing
136            attributeValue = xpp.getAttributeValue( "", "processing" );
137
138            if ( attributeValue != null )
139            {
140                if ( "sequential".equals( attributeValue ) )
141                {
142                    batchRequest.setProcessing( Processing.SEQUENTIAL );
143                }
144                else if ( "parallel".equals( attributeValue ) )
145                {
146                    batchRequest.setProcessing( Processing.PARALLEL );
147                }
148                else
149                {
150                    throw new XmlPullParserException( I18n.err( I18n.ERR_03013_UNKNOWN_PROCESSING_VALUE ), xpp, null );
151                }
152            }
153            else
154            {
155                batchRequest.setProcessing( Processing.SEQUENTIAL );
156            }
157
158            // onError
159            attributeValue = xpp.getAttributeValue( "", "onError" );
160
161            if ( attributeValue != null )
162            {
163                if ( "resume".equals( attributeValue ) )
164                {
165                    batchRequest.setOnError( OnError.RESUME );
166                }
167                else if ( "exit".equals( attributeValue ) )
168                {
169                    batchRequest.setOnError( OnError.EXIT );
170                }
171                else
172                {
173                    throw new XmlPullParserException( I18n.err( I18n.ERR_03014_UNKNOWN_ON_ERROR_VALUE ), xpp, null );
174                }
175            }
176            else
177            {
178                batchRequest.setOnError( OnError.EXIT );
179            }
180
181            // responseOrder
182            attributeValue = xpp.getAttributeValue( "", "responseOrder" );
183
184            if ( attributeValue != null )
185            {
186                if ( "sequential".equals( attributeValue ) )
187                {
188                    batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL );
189                }
190                else if ( "unordered".equals( attributeValue ) )
191                {
192                    batchRequest.setResponseOrder( ResponseOrder.UNORDERED );
193                }
194                else
195                {
196                    throw new XmlPullParserException( I18n.err( I18n.ERR_03015_UNKNOWN_RESPONSE_ORDER_VALUE ), xpp, null );
197                }
198            }
199            else
200            {
201                batchRequest.setResponseOrder( ResponseOrder.SEQUENTIAL );
202            }
203        }
204    };
205
206    /**
207     * GrammarAction that creates an Abandon Request
208     */
209    private final GrammarAction abandonRequestCreation = new GrammarAction( "Create Abandon Request" )
210    {
211        /**
212         * {@inheritDoc}
213         */
214        @Override
215        public void action( Dsmlv2Container container ) throws XmlPullParserException
216        {
217            AbandonRequestDsml abandonRequest = new AbandonRequestDsml( codec, new AbandonRequestImpl() );
218            container.getBatchRequest().addRequest( abandonRequest );
219
220            XmlPullParser xpp = container.getParser();
221
222            // Checking and adding the request's attributes
223            String attributeValue;
224            // requestID
225            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
226
227            if ( attributeValue != null )
228            {
229                abandonRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
230            }
231            else
232            {
233                if ( ParserUtils.isRequestIdNeeded( container ) )
234                {
235                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
236                }
237            }
238
239            // abandonID
240            attributeValue = xpp.getAttributeValue( "", "abandonID" );
241
242            if ( attributeValue != null )
243            {
244                try
245                {
246                    abandonRequest.setAbandoned( Integer.parseInt( attributeValue ) );
247                }
248                catch ( NumberFormatException nfe )
249                {
250                    throw new XmlPullParserException( I18n.err( I18n.ERR_03017_ABANDON_ID_NOT_INTEGER ), xpp, nfe );
251                }
252            }
253            else
254            {
255                throw new XmlPullParserException( I18n.err( I18n.ERR_03018_ABANDON_ID_REQUIRED ), xpp, null );
256            }
257        }
258    };
259
260    /**
261     * GrammarAction that creates an Add Request
262     */
263    private final GrammarAction addRequestCreation = new GrammarAction( "Create Add Request" )
264    {
265        /**
266         * {@inheritDoc}
267         */
268        @Override
269        public void action( Dsmlv2Container container ) throws XmlPullParserException
270        {
271            AddRequestDsml addRequest = new AddRequestDsml( codec, new AddRequestImpl() );
272            container.getBatchRequest().addRequest( addRequest );
273
274            XmlPullParser xpp = container.getParser();
275
276            // Checking and adding the request's attributes
277            String attributeValue;
278            // requestID
279            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
280
281            if ( attributeValue != null )
282            {
283                addRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
284            }
285            else
286            {
287                if ( ParserUtils.isRequestIdNeeded( container ) )
288                {
289                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
290                }
291            }
292
293            // dn
294            attributeValue = xpp.getAttributeValue( "", "dn" );
295
296            if ( attributeValue != null )
297            {
298                try
299                {
300                    addRequest.setEntryDn( new Dn( attributeValue ) );
301                }
302                catch ( LdapInvalidDnException lide )
303                {
304                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
305                }
306            }
307            else
308            {
309                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
310            }
311        }
312    };
313
314    /**
315     * GrammarAction that adds an attribute to an Add Request
316     */
317    private final GrammarAction addRequestAddAttribute = new GrammarAction( "Add Attribute to Add Request" )
318    {
319        /**
320         * {@inheritDoc}
321         */
322        @Override
323        public void action( Dsmlv2Container container ) throws XmlPullParserException
324        {
325            AddRequestDsml addRequest = ( AddRequestDsml )
326                container.getBatchRequest().getCurrentRequest();
327
328            XmlPullParser xpp = container.getParser();
329
330            // Checking and adding the request's attributes
331            String attributeValue;
332            // name
333            attributeValue = xpp.getAttributeValue( "", NAME );
334
335            if ( attributeValue != null )
336            {
337                try
338                {
339                    addRequest.addAttributeType( attributeValue );
340                }
341                catch ( LdapException le )
342                {
343                    throw new XmlPullParserException( I18n.err( I18n.ERR_03020_CANT_ADD_ATTRIBUTE_VALUE ), xpp, le );
344                }
345            }
346            else
347            {
348                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
349            }
350        }
351    };
352
353    /**
354     * GrammarAction that adds a Value to an Attribute of an Add Request
355     */
356    private final GrammarAction addRequestAddValue = new GrammarAction( "Add Value to Attribute" )
357    {
358        /**
359         * {@inheritDoc}
360         */
361        @Override
362        public void action( Dsmlv2Container container ) throws XmlPullParserException
363        {
364            AddRequestDsml addRequest = ( AddRequestDsml )
365                container.getBatchRequest().getCurrentRequest();
366
367            XmlPullParser xpp = container.getParser();
368
369            try
370            {
371                // We have to catch the type Attribute Value before going to the next Text node
372                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
373
374                // Getting the value
375                String nextText = xpp.nextText();
376
377                if ( !Strings.isEmpty( nextText ) )
378                {
379                    try
380                    {
381                        if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
382                        {
383                            addRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) );
384                        }
385                        else
386                        {
387                            addRequest.addAttributeValue( nextText.trim() );
388                        }
389                    }
390                    catch ( LdapException le )
391                    {
392                        throw new XmlPullParserException( le.getMessage(), xpp, le );
393                    }
394                }
395            }
396            catch ( IOException ioe )
397            {
398                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
399            }
400        }
401    };
402
403    /**
404     * GrammarAction that creates an Auth Request
405     */
406    private final GrammarAction authRequestCreation = new GrammarAction( "Create Auth Request" )
407    {
408        /**
409         * {@inheritDoc}
410         */
411        @Override
412        public void action( Dsmlv2Container container ) throws XmlPullParserException
413        {
414            BindRequestDsml authRequest = new BindRequestDsml( codec, new BindRequestImpl() );
415            container.getBatchRequest().addRequest( authRequest );
416
417            authRequest.setSimple( true );
418            authRequest.setVersion3( true );
419
420            XmlPullParser xpp = container.getParser();
421
422            // Checking and adding the request's attributes
423            String attributeValue;
424            // requestID
425            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
426
427            if ( attributeValue != null )
428            {
429                authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
430            }
431            else
432            {
433                if ( ParserUtils.isRequestIdNeeded( container ) )
434                {
435                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
436                }
437            }
438            // principal
439            attributeValue = xpp.getAttributeValue( "", "principal" );
440
441            if ( attributeValue != null )
442            {
443                authRequest.setName( attributeValue );
444            }
445            else
446            {
447                throw new XmlPullParserException( I18n.err( I18n.ERR_03021_PRINCIPAL_ATTRIBUTE_REQUIRED ), xpp, null );
448            }
449        }
450    };
451
452    /**
453     * GrammarAction that creates an Compare Request
454     */
455    private final GrammarAction compareRequestCreation = new GrammarAction( "Create Compare Request" )
456    {
457        /**
458         * {@inheritDoc}
459         */
460        @Override
461        public void action( Dsmlv2Container container ) throws XmlPullParserException
462        {
463            CompareRequestDsml compareRequest = new CompareRequestDsml( codec, new CompareRequestImpl() );
464            container.getBatchRequest().addRequest( compareRequest );
465
466            XmlPullParser xpp = container.getParser();
467
468            // Checking and adding the request's attributes
469            String attributeValue;
470            // requestID
471            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
472
473            if ( attributeValue != null )
474            {
475                compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
476            }
477            else
478            {
479                if ( ParserUtils.isRequestIdNeeded( container ) )
480                {
481                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
482                }
483            }
484
485            // dn
486            attributeValue = xpp.getAttributeValue( "", "dn" );
487
488            if ( attributeValue != null )
489            {
490                try
491                {
492                    compareRequest.setName( new Dn( attributeValue ) );
493                }
494                catch ( LdapInvalidDnException lide )
495                {
496                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
497                }
498            }
499            else
500            {
501                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
502            }
503        }
504    };
505
506    /**
507     * GrammarAction that adds an Assertion to a Compare Request
508     */
509    private final GrammarAction compareRequestAddAssertion = new GrammarAction( "Add Assertion to Compare Request" )
510    {
511        /**
512         * {@inheritDoc}
513         */
514        @Override
515        public void action( Dsmlv2Container container ) throws XmlPullParserException
516        {
517            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
518
519            XmlPullParser xpp = container.getParser();
520
521            // Checking and adding the request's attributes
522            String attributeId;
523
524            // name
525            attributeId = xpp.getAttributeValue( "", NAME );
526
527            if ( attributeId != null )
528            {
529                compareRequest.setAttributeId( attributeId );
530            }
531            else
532            {
533                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
534            }
535        }
536    };
537
538    /**
539     * GrammarAction that adds a Value to a Compare Request
540     */
541    private final GrammarAction compareRequestAddValue = new GrammarAction( "Add Value to Compare Request" )
542    {
543        /**
544         * {@inheritDoc}
545         */
546        @Override
547        public void action( Dsmlv2Container container ) throws XmlPullParserException
548        {
549            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
550
551            XmlPullParser xpp = container.getParser();
552
553            try
554            {
555                // We have to catch the type Attribute Value before going to the next Text node
556                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
557
558                // Getting the value
559                String nextText = xpp.nextText();
560
561                if ( !Strings.isEmpty( nextText ) )
562                {
563                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
564                    {
565                        compareRequest.setAssertionValue( Base64.decode( nextText.trim().toCharArray() ) );
566                    }
567                    else
568                    {
569                        compareRequest.setAssertionValue( nextText.trim() );
570                    }
571                }
572            }
573            catch ( IOException ioe )
574            {
575                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
576            }
577        }
578    };
579
580    /**
581     * GrammarAction that creates a Del Request
582     */
583    private final GrammarAction delRequestCreation = new GrammarAction( "Create Del Request" )
584    {
585        /**
586         * {@inheritDoc}
587         */
588        @Override
589        public void action( Dsmlv2Container container ) throws XmlPullParserException
590        {
591            DelRequestDsml delRequest = new DelRequestDsml( codec, new DeleteRequestImpl() );
592            container.getBatchRequest().addRequest( delRequest );
593
594            XmlPullParser xpp = container.getParser();
595
596            // Checking and adding the request's attributes
597            String attributeValue;
598            // requestID
599            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
600
601            if ( attributeValue != null )
602            {
603                delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
604            }
605            else
606            {
607                if ( ParserUtils.isRequestIdNeeded( container ) )
608                {
609                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
610                }
611            }
612
613            // dn
614            attributeValue = xpp.getAttributeValue( "", "dn" );
615
616            if ( attributeValue != null )
617            {
618                try
619                {
620                    delRequest.setName( new Dn( attributeValue ) );
621                }
622                catch ( LdapInvalidDnException lide )
623                {
624                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
625                }
626            }
627            else
628            {
629                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
630            }
631        }
632    };
633
634    /**
635     * GrammarAction that creates an Extended Request
636     */
637    private final GrammarAction extendedRequestCreation = new GrammarAction( "Create Extended Request" )
638    {
639        /**
640         * {@inheritDoc}
641         */
642        @Override
643        public void action( Dsmlv2Container container ) throws XmlPullParserException
644        {
645            ExtendedRequestDsml<?, ?> extendedRequest =
646                new ExtendedRequestDsml<>( codec,
647                    new OpaqueExtendedRequest() );
648            container.getBatchRequest().addRequest( extendedRequest );
649
650            XmlPullParser xpp = container.getParser();
651
652            // Checking and adding the request's attributes
653            String attributeValue;
654            // requestID
655            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
656
657            if ( attributeValue != null )
658            {
659                extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
660            }
661            else
662            {
663                if ( ParserUtils.isRequestIdNeeded( container ) )
664                {
665                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
666                }
667            }
668        }
669    };
670
671    /**
672     * GrammarAction that adds a Name to an Extended Request
673     */
674    private final GrammarAction extendedRequestAddName = new GrammarAction( "Add Name to Extended Request" )
675    {
676        /**
677         * {@inheritDoc}
678         */
679        @Override
680        public void action( Dsmlv2Container container ) throws XmlPullParserException
681        {
682            ExtendedRequestDsml<?, ?> extendedRequest = ( ExtendedRequestDsml<?, ?> )
683                container.getBatchRequest().getCurrentRequest();
684
685            XmlPullParser xpp = container.getParser();
686
687            try
688            {
689                String nextText = xpp.nextText();
690
691                if ( Strings.isEmpty( nextText ) )
692                {
693                    throw new XmlPullParserException( I18n.err( I18n.ERR_03022_NULL_REQUEST_NAME ), xpp, null );
694                }
695                else
696                {
697                    String oid = nextText.trim();
698
699                    if ( Oid.isOid( oid ) )
700                    {
701                        extendedRequest.setRequestName( nextText.trim() );
702                    }
703                    else
704                    {
705                        throw new XmlPullParserException( I18n.err( I18n.ERR_03038_BAD_OID, oid ), xpp, null );
706                    }
707                }
708            }
709            catch ( IOException ioe )
710            {
711                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
712            }
713        }
714    };
715
716    /**
717     * GrammarAction that adds a Value to an Extended Request
718     */
719    private final GrammarAction extendedRequestAddValue = new GrammarAction( "Add Value to Extended Request" )
720    {
721        /**
722         * {@inheritDoc}
723         */
724        @Override
725        public void action( Dsmlv2Container container ) throws XmlPullParserException
726        {
727            ExtendedRequestDsml<?, ?> extendedRequest = ( ExtendedRequestDsml<?, ?> )
728                container.getBatchRequest().getCurrentRequest();
729
730            XmlPullParser xpp = container.getParser();
731
732            try
733            {
734                // We have to catch the type Attribute Value before going to the next Text node
735                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
736
737                // Getting the value
738                String nextText = xpp.nextText();
739
740                if ( !Strings.isEmpty( nextText ) )
741                {
742                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
743                    {
744                        extendedRequest.setRequestValue( Base64.decode( nextText.trim().toCharArray() ) );
745                    }
746                    else
747                    {
748                        extendedRequest.setRequestValue( Strings.getBytesUtf8( nextText.trim() ) );
749                    }
750                }
751            }
752            catch ( IOException ioe )
753            {
754                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
755            }
756        }
757    };
758
759    /**
760     * GrammarAction that creates a Modify Dn Request
761     */
762    private final GrammarAction modDNRequestCreation = new GrammarAction( "Create Modify Dn Request" )
763    {
764        /**
765         * {@inheritDoc}
766         */
767        @Override
768        public void action( Dsmlv2Container container ) throws XmlPullParserException
769        {
770            ModifyDNRequestDsml modifyDNRequest = new ModifyDNRequestDsml( codec, new ModifyDnRequestImpl() );
771            container.getBatchRequest().addRequest( modifyDNRequest );
772
773            XmlPullParser xpp = container.getParser();
774
775            // Checking and adding the request's attributes
776            String attributeValue;
777            // requestID
778            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
779
780            if ( attributeValue != null )
781            {
782                modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
783            }
784            else
785            {
786                if ( ParserUtils.isRequestIdNeeded( container ) )
787                {
788                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
789                }
790            }
791
792            // dn
793            attributeValue = xpp.getAttributeValue( "", "dn" );
794
795            if ( attributeValue != null )
796            {
797                try
798                {
799                    modifyDNRequest.setName( new Dn( attributeValue ) );
800                }
801                catch ( LdapInvalidDnException lide )
802                {
803                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
804                }
805            }
806            else
807            {
808                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
809            }
810
811            // newrdn
812            attributeValue = xpp.getAttributeValue( "", "newrdn" );
813
814            if ( attributeValue != null )
815            {
816                try
817                {
818                    modifyDNRequest.setNewRdn( new Rdn( attributeValue ) );
819                }
820                catch ( LdapInvalidDnException lide )
821                {
822                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
823                }
824            }
825            else
826            {
827                throw new XmlPullParserException( I18n.err( I18n.ERR_03023_NEW_RDN_ATTRIBUTE_REQUESTED ), xpp, null );
828            }
829
830            // deleteoldrdn
831            attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" );
832
833            if ( attributeValue != null )
834            {
835                if ( ( attributeValue.equalsIgnoreCase( TRUE ) ) || ( "1".equals( attributeValue ) ) )
836                {
837                    modifyDNRequest.setDeleteOldRdn( true );
838                }
839                else if ( ( attributeValue.equalsIgnoreCase( FALSE ) ) || ( "0".equals( attributeValue ) ) )
840                {
841                    modifyDNRequest.setDeleteOldRdn( false );
842                }
843                else
844                {
845                    throw new XmlPullParserException( I18n.err( I18n.ERR_03024_INCORRECT_DELETE_OLD_RDN_VALUE ), xpp, null );
846                }
847            }
848            else
849            {
850                modifyDNRequest.setDeleteOldRdn( true );
851            }
852
853            // newsuperior
854            attributeValue = xpp.getAttributeValue( "", "newSuperior" );
855
856            if ( attributeValue != null )
857            {
858                try
859                {
860                    modifyDNRequest.setNewSuperior( new Dn( attributeValue ) );
861                }
862                catch ( LdapInvalidDnException lide )
863                {
864                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
865                }
866            }
867        }
868    };
869
870    /**
871     * GrammarAction that creates a Modify Request
872     */
873    private final GrammarAction modifyRequestCreation = new GrammarAction( "Create Modify Request" )
874    {
875        /**
876         * {@inheritDoc}
877         */
878        @Override
879        public void action( Dsmlv2Container container ) throws XmlPullParserException
880        {
881            ModifyRequestDsml modifyRequest = new ModifyRequestDsml( codec, new ModifyRequestImpl() );
882            container.getBatchRequest().addRequest( modifyRequest );
883
884            XmlPullParser xpp = container.getParser();
885
886            // Checking and adding the request's attributes
887            String attributeValue;
888            // requestID
889            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
890
891            if ( attributeValue != null )
892            {
893                modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
894            }
895            else
896            {
897                if ( ParserUtils.isRequestIdNeeded( container ) )
898                {
899                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
900                }
901            }
902
903            // dn
904            attributeValue = xpp.getAttributeValue( "", "dn" );
905
906            if ( attributeValue != null )
907            {
908                try
909                {
910                    modifyRequest.setName( new Dn( attributeValue ) );
911                }
912                catch ( LdapInvalidDnException lide )
913                {
914                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getLocalizedMessage() ), xpp, lide );
915                }
916            }
917            else
918            {
919                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
920            }
921        }
922    };
923
924    /**
925     * GrammarAction that adds a Modification to a Modify Request
926     */
927    private final GrammarAction modifyRequestAddModification = new GrammarAction( "Adds Modification to Modify Request" )
928    {
929        /**
930         * {@inheritDoc}
931         */
932        @Override
933        public void action( Dsmlv2Container container ) throws XmlPullParserException
934        {
935            ModifyRequestDsml modifyRequest = ( ModifyRequestDsml )
936                container.getBatchRequest().getCurrentRequest();
937
938            XmlPullParser xpp = container.getParser();
939
940            // Checking and adding the request's attributes
941            String attributeValue;
942            // operation
943            attributeValue = xpp.getAttributeValue( "", "operation" );
944
945            if ( attributeValue != null )
946            {
947                if ( "add".equals( attributeValue ) )
948                {
949                    modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_ADD );
950                }
951                else if ( "delete".equals( attributeValue ) )
952                {
953                    modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_DELETE );
954                }
955                else if ( "replace".equals( attributeValue ) )
956                {
957                    modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_REPLACE );
958                }
959                else if ( "increment".equals( attributeValue ) )
960                {
961                    modifyRequest.setCurrentOperation( LdapCodecConstants.OPERATION_INCREMENT );
962                }
963                else
964                {
965                    throw new XmlPullParserException( I18n.err( I18n.ERR_03040_UNKNOWN_OPERATION ), xpp, null );
966                }
967            }
968            else
969            {
970                throw new XmlPullParserException( I18n.err( I18n.ERR_03025_OPERATION_TTRIBUTE_REQUIRED ), xpp, null );
971            }
972
973            // name
974            attributeValue = xpp.getAttributeValue( "", NAME );
975
976            if ( attributeValue != null )
977            {
978                modifyRequest.addAttributeTypeAndValues( attributeValue );
979            }
980            else
981            {
982                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
983            }
984        }
985    };
986
987    /**
988     * GrammarAction that adds a Value to a Modification of a Modify Request
989     */
990    private final GrammarAction modifyRequestAddValue = new GrammarAction(
991        "Add Value to Modification of Modify Request" )
992    {
993        /**
994         * {@inheritDoc}
995         */
996        @Override
997        public void action( Dsmlv2Container container ) throws XmlPullParserException
998        {
999            ModifyRequestDsml modifyRequest = ( ModifyRequestDsml )
1000                container.getBatchRequest().getCurrentRequest();
1001
1002            XmlPullParser xpp = container.getParser();
1003
1004            try
1005            {
1006                // We have to catch the type Attribute Value before going to the next Text node
1007                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1008
1009                // Getting the value
1010                String nextText = xpp.nextText();
1011                // We are testing if nextText equals "" since a modification can be "".
1012
1013                try
1014                {
1015                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1016                    {
1017                        modifyRequest.addAttributeValue( Base64.decode( nextText.trim().toCharArray() ) );
1018                    }
1019                    else
1020                    {
1021                        modifyRequest.addAttributeValue( nextText.trim() );
1022                    }
1023                }
1024                catch ( LdapException le )
1025                {
1026                    throw new XmlPullParserException( le.getMessage(), xpp, le );
1027                }
1028            }
1029            catch ( IOException ioe )
1030            {
1031                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1032            }
1033        }
1034    };
1035
1036    /**
1037     * GrammarAction that creates a Search Request
1038     */
1039    private final GrammarAction searchRequestCreation = new GrammarAction( "Create Search Request" )
1040    {
1041        /**
1042         * {@inheritDoc}
1043         */
1044        @Override
1045        public void action( Dsmlv2Container container ) throws XmlPullParserException
1046        {
1047            SearchRequestDsml searchRequest = new SearchRequestDsml( codec, new SearchRequestImpl() );
1048            container.getBatchRequest().addRequest( searchRequest );
1049
1050            XmlPullParser xpp = container.getParser();
1051
1052            // Checking and adding the request's attributes
1053            String attributeValue;
1054            // requestID
1055            attributeValue = xpp.getAttributeValue( "", REQUEST_ID );
1056
1057            if ( attributeValue != null )
1058            {
1059                searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
1060            }
1061            else
1062            {
1063                if ( ParserUtils.isRequestIdNeeded( container ) )
1064                {
1065                    throw new XmlPullParserException( I18n.err( I18n.ERR_03000_REQUEST_ID_REQUIRED ), xpp, null );
1066                }
1067            }
1068
1069            // dn
1070            attributeValue = xpp.getAttributeValue( "", "dn" );
1071
1072            if ( attributeValue != null )
1073            {
1074                try
1075                {
1076                    searchRequest.setBase( new Dn( attributeValue ) );
1077                }
1078                catch ( LdapInvalidDnException lide )
1079                {
1080                    throw new XmlPullParserException( I18n.err( I18n.ERR_03039_PARSING_ERROR, lide.getMessage() ), xpp, lide );
1081                }
1082            }
1083            else
1084            {
1085                throw new XmlPullParserException( I18n.err( I18n.ERR_03001_DN_ATTRIBUTE_REQUIRED ), xpp, null );
1086            }
1087
1088            // scope
1089            attributeValue = xpp.getAttributeValue( "", "scope" );
1090
1091            if ( attributeValue != null )
1092            {
1093                if ( "baseObject".equals( attributeValue ) )
1094                {
1095                    searchRequest.setScope( SearchScope.OBJECT );
1096                }
1097                else if ( "singleLevel".equals( attributeValue ) )
1098                {
1099                    searchRequest.setScope( SearchScope.ONELEVEL );
1100                }
1101                else if ( "wholeSubtree".equals( attributeValue ) )
1102                {
1103                    searchRequest.setScope( SearchScope.SUBTREE );
1104                }
1105                else
1106                {
1107                    throw new XmlPullParserException( I18n.err( I18n.ERR_03026_UNKNOWN_SCOPE ), xpp, null );
1108                }
1109            }
1110            else
1111            {
1112                throw new XmlPullParserException( I18n.err( I18n.ERR_03027_SCOPE_ATTRIBUTE_REQUIRED ), xpp, null );
1113            }
1114
1115            // derefAliases
1116            attributeValue = xpp.getAttributeValue( "", "derefAliases" );
1117
1118            if ( attributeValue != null )
1119            {
1120                if ( "neverDerefAliases".equals( attributeValue ) )
1121                {
1122                    searchRequest.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
1123                }
1124                else if ( "derefInSearching".equals( attributeValue ) )
1125                {
1126                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_IN_SEARCHING );
1127                }
1128                else if ( "derefFindingBaseObj".equals( attributeValue ) )
1129                {
1130                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_FINDING_BASE_OBJ );
1131                }
1132                else if ( "derefAlways".equals( attributeValue ) )
1133                {
1134                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS );
1135                }
1136                else
1137                {
1138                    throw new XmlPullParserException( I18n.err( I18n.ERR_03028_UNKNOWN_DEREFALIAS_VALUE ), xpp, null );
1139                }
1140            }
1141            else
1142            {
1143                throw new XmlPullParserException( I18n.err( I18n.ERR_03029_DEREFALIA_ATTRIBUTE_REQUIRED ), xpp, null );
1144            }
1145
1146            // sizeLimit
1147            attributeValue = xpp.getAttributeValue( "", "sizeLimit" );
1148
1149            if ( attributeValue != null )
1150            {
1151                try
1152                {
1153                    searchRequest.setSizeLimit( Long.parseLong( attributeValue ) );
1154                }
1155                catch ( NumberFormatException nfe )
1156                {
1157                    throw new XmlPullParserException( I18n.err( I18n.ERR_03030_SIZE_LIMIT_NOT_INTEGER ), xpp, nfe );
1158                }
1159            }
1160            else
1161            {
1162                searchRequest.setSizeLimit( 0L );
1163            }
1164
1165            // timeLimit
1166            attributeValue = xpp.getAttributeValue( "", "timeLimit" );
1167
1168            if ( attributeValue != null )
1169            {
1170                try
1171                {
1172                    searchRequest.setTimeLimit( Integer.parseInt( attributeValue ) );
1173                }
1174                catch ( NumberFormatException nfe )
1175                {
1176                    throw new XmlPullParserException( I18n.err( I18n.ERR_03031_TIME_LIMIT_NOT_INTEGER ), xpp, nfe );
1177                }
1178            }
1179            else
1180            {
1181                searchRequest.setTimeLimit( 0 );
1182            }
1183
1184            // typesOnly
1185            attributeValue = xpp.getAttributeValue( "", "typesOnly" );
1186
1187            if ( attributeValue != null )
1188            {
1189                if ( ( attributeValue.equals( TRUE ) ) || ( "1".equals( attributeValue ) ) )
1190                {
1191                    searchRequest.setTypesOnly( true );
1192                }
1193                else if ( ( attributeValue.equals( FALSE ) ) || ( "0".equals( attributeValue ) ) )
1194                {
1195                    searchRequest.setTypesOnly( false );
1196                }
1197                else
1198                {
1199                    throw new XmlPullParserException( I18n.err( I18n.ERR_03032_TYPES_ONLY_NOT_BOOLEAN ), xpp, null );
1200                }
1201            }
1202            else
1203            {
1204                searchRequest.setTypesOnly( false );
1205            }
1206        }
1207    };
1208
1209    /**
1210     * GrammarAction that adds an Attribute to a Search Request
1211     */
1212    private final GrammarAction searchRequestAddAttribute = new GrammarAction(
1213        "Add Value to Modification of Modify Request" )
1214    {
1215        /**
1216         * {@inheritDoc}
1217         */
1218        @Override
1219        public void action( Dsmlv2Container container ) throws XmlPullParserException
1220        {
1221            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
1222
1223            XmlPullParser xpp = container.getParser();
1224
1225            // Checking and adding the request's attribute name
1226            String attributeName = xpp.getAttributeValue( "", NAME );
1227
1228            if ( attributeName != null )
1229            {
1230                searchRequest.addAttributes( attributeName );
1231            }
1232            else
1233            {
1234                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1235            }
1236        }
1237    };
1238
1239    /**
1240     * GrammarAction that create a Substring Filter
1241     */
1242    private final GrammarAction substringsFilterCreation = new GrammarAction( "Create Substring Filter" )
1243    {
1244        /**
1245         * {@inheritDoc}
1246         */
1247        @Override
1248        public void action( Dsmlv2Container container ) throws XmlPullParserException
1249        {
1250            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1251                container.getBatchRequest().getCurrentRequest();
1252
1253            XmlPullParser xpp = container.getParser();
1254
1255            SubstringFilter filter = new SubstringFilter();
1256
1257            // Adding the filter to the Search Filter
1258            try
1259            {
1260                searchRequestDecorator.addCurrentFilter( filter );
1261            }
1262            catch ( DecoderException de )
1263            {
1264                throw new XmlPullParserException( de.getMessage(), xpp, de );
1265            }
1266
1267            searchRequestDecorator.setTerminalFilter( filter );
1268
1269            // Checking and adding the filter's attributes
1270            String attributeValue;
1271            // name
1272            attributeValue = xpp.getAttributeValue( "", NAME );
1273
1274            if ( attributeValue != null )
1275            {
1276                filter.setType( attributeValue );
1277            }
1278            else
1279            {
1280                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1281            }
1282        }
1283    };
1284
1285    /**
1286     * GrammarAction that sets the Initial value to a Substring Filter
1287     */
1288    private final GrammarAction substringsFilterSetInitial = new GrammarAction( "Set Initial value to Substring Filter" )
1289    {
1290        /**
1291         * {@inheritDoc}
1292         */
1293        @Override
1294        public void action( Dsmlv2Container container ) throws XmlPullParserException
1295        {
1296            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1297                container.getBatchRequest().getCurrentRequest();
1298
1299            SubstringFilter substringFilter = ( SubstringFilter )
1300                searchRequestDecorator.getTerminalFilter();
1301
1302            XmlPullParser xpp = container.getParser();
1303
1304            try
1305            {
1306                // We have to catch the type Attribute Value before going to the next Text node
1307                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1308
1309                // Getting the value
1310                String nextText = xpp.nextText();
1311
1312                if ( !Strings.isEmpty( nextText ) )
1313                {
1314                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1315                    {
1316                        substringFilter
1317                            .setInitialSubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) );
1318                    }
1319                    else
1320                    {
1321                        substringFilter.setInitialSubstrings( nextText.trim() );
1322                    }
1323                }
1324            }
1325            catch ( IOException ioe )
1326            {
1327                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1328            }
1329        }
1330    };
1331
1332    /**
1333     * GrammarAction that adds a Any value to a Substring Filter
1334     */
1335    private final GrammarAction substringsFilterAddAny = new GrammarAction( "Add Any value to Substring Filter" )
1336    {
1337        /**
1338         * {@inheritDoc}
1339         */
1340        @Override
1341        public void action( Dsmlv2Container container ) throws XmlPullParserException
1342        {
1343            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1344                container.getBatchRequest().getCurrentRequest();
1345
1346            SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter();
1347
1348            XmlPullParser xpp = container.getParser();
1349
1350            try
1351            {
1352                // We have to catch the type Attribute Value before going to the next Text node
1353                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1354
1355                // Getting the value
1356                String nextText = xpp.nextText();
1357
1358                if ( !Strings.isEmpty( nextText ) )
1359                {
1360                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1361                    {
1362                        substringFilter.addAnySubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) );
1363                    }
1364                    else
1365                    {
1366                        substringFilter.addAnySubstrings( nextText.trim() );
1367                    }
1368                }
1369            }
1370            catch ( IOException ioe )
1371            {
1372                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1373            }
1374        }
1375    };
1376
1377    /**
1378     * GrammarAction that sets the Final value to a Substring Filter
1379     */
1380    private final GrammarAction substringsFilterSetFinal = new GrammarAction( "Set Final value to Substring Filter" )
1381    {
1382        /**
1383         * {@inheritDoc}
1384         */
1385        @Override
1386        public void action( Dsmlv2Container container ) throws XmlPullParserException
1387        {
1388            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1389                container.getBatchRequest().getCurrentRequest();
1390
1391            SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter();
1392
1393            XmlPullParser xpp = container.getParser();
1394
1395            try
1396            {
1397                // We have to catch the type Attribute Value before going to the next Text node
1398                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1399
1400                // Getting the value
1401                String nextText = xpp.nextText();
1402
1403                if ( !Strings.isEmpty( nextText ) )
1404                {
1405                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1406                    {
1407                        substringFilter
1408                            .setFinalSubstrings( Strings.utf8ToString( Base64.decode( nextText.trim().toCharArray() ) ) );
1409                    }
1410                    else
1411                    {
1412                        substringFilter.setFinalSubstrings( nextText.trim() );
1413                    }
1414                }
1415            }
1416            catch ( IOException ioe )
1417            {
1418                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1419            }
1420        }
1421    };
1422
1423    /**
1424     * GrammarAction that closes a Substring Filter
1425     */
1426    private final GrammarAction substringsFilterClose = new GrammarAction( "Close Substring Filter" )
1427    {
1428        /**
1429         * {@inheritDoc}
1430         */
1431        @Override
1432        public void action( Dsmlv2Container container ) throws XmlPullParserException
1433        {
1434            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1435                container.getBatchRequest().getCurrentRequest();
1436
1437            searchRequestDecorator.setTerminalFilter( null );
1438        }
1439    };
1440
1441    /**
1442     * GrammarAction that create a And Filter
1443     */
1444    private final GrammarAction andFilterCreation = new GrammarAction( "Create And Filter" )
1445    {
1446        /**
1447         * {@inheritDoc}
1448         */
1449        @Override
1450        public void action( Dsmlv2Container container ) throws XmlPullParserException
1451        {
1452            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1453                container.getBatchRequest().getCurrentRequest();
1454
1455            XmlPullParser xpp = container.getParser();
1456
1457            AndFilter filter = new AndFilter();
1458
1459            // Adding the filter to the Search Filter
1460            try
1461            {
1462                searchRequestDecorator.addCurrentFilter( filter );
1463            }
1464            catch ( DecoderException de )
1465            {
1466                throw new XmlPullParserException( de.getMessage(), xpp, de );
1467            }
1468        }
1469    };
1470
1471    /**
1472     * GrammarAction that closes a Connector Filter (And, Or, Not)
1473     */
1474    private final GrammarAction connectorFilterClose = new GrammarAction( "Close Connector Filter" )
1475    {
1476        /**
1477         * {@inheritDoc}
1478         */
1479        @Override
1480        public void action( Dsmlv2Container container ) throws XmlPullParserException
1481        {
1482            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1483                container.getBatchRequest().getCurrentRequest();
1484
1485            searchRequestDecorator.endCurrentConnectorFilter();
1486        }
1487    };
1488
1489    /**
1490     * GrammarAction that create a Or Filter
1491     */
1492    private final GrammarAction orFilterCreation = new GrammarAction( "Create Or Filter" )
1493    {
1494        /**
1495         * {@inheritDoc}
1496         */
1497        @Override
1498        public void action( Dsmlv2Container container ) throws XmlPullParserException
1499        {
1500            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1501                container.getBatchRequest().getCurrentRequest();
1502
1503            XmlPullParser xpp = container.getParser();
1504
1505            OrFilter filter = new OrFilter();
1506
1507            // Adding the filter to the Search Filter
1508            try
1509            {
1510                searchRequestDecorator.addCurrentFilter( filter );
1511            }
1512            catch ( DecoderException de )
1513            {
1514                throw new XmlPullParserException( de.getMessage(), xpp, de );
1515            }
1516        }
1517    };
1518
1519    /**
1520     * GrammarAction that create a Not Filter
1521     */
1522    private final GrammarAction notFilterCreation = new GrammarAction( "Create Not Filter" )
1523    {
1524        /**
1525         * {@inheritDoc}
1526         */
1527        @Override
1528        public void action( Dsmlv2Container container ) throws XmlPullParserException
1529        {
1530            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1531                container.getBatchRequest().getCurrentRequest();
1532
1533            XmlPullParser xpp = container.getParser();
1534
1535            NotFilter filter = new NotFilter();
1536
1537            // Adding the filter to the Search Filter
1538            try
1539            {
1540                searchRequestDecorator.addCurrentFilter( filter );
1541            }
1542            catch ( DecoderException de )
1543            {
1544                throw new XmlPullParserException( de.getMessage(), xpp, de );
1545            }
1546        }
1547    };
1548
1549    /**
1550     * GrammarAction that create a Equality Match Filter
1551     */
1552    private final GrammarAction equalityMatchFilterCreation = new GrammarAction( "Create Equality Match Filter" )
1553    {
1554        /**
1555         * {@inheritDoc}
1556         */
1557        @Override
1558        public void action( Dsmlv2Container container ) throws XmlPullParserException
1559        {
1560            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1561                container.getBatchRequest().getCurrentRequest();
1562
1563            XmlPullParser xpp = container.getParser();
1564
1565            AttributeValueAssertion assertion = new AttributeValueAssertion();
1566
1567            // Checking and adding the filter's attributes
1568            String attributeName = xpp.getAttributeValue( "", NAME );
1569
1570            if ( attributeName != null )
1571            {
1572                assertion.setAttributeDesc( attributeName );
1573            }
1574            else
1575            {
1576                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1577            }
1578
1579            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
1580                LdapCodecConstants.EQUALITY_MATCH_FILTER );
1581
1582            filter.setAssertion( assertion );
1583
1584            // Adding the filter to the Search Filter
1585            try
1586            {
1587                searchRequestDecorator.addCurrentFilter( filter );
1588            }
1589            catch ( DecoderException de )
1590            {
1591                throw new XmlPullParserException( de.getMessage(), xpp, de );
1592            }
1593
1594            searchRequestDecorator.setTerminalFilter( filter );
1595        }
1596    };
1597
1598    /**
1599     * GrammarAction that create a Greater Or Equal Filter
1600     */
1601    private final GrammarAction greaterOrEqualFilterCreation = new GrammarAction( "Create Greater Or Equal Filter" )
1602    {
1603        /**
1604         * {@inheritDoc}
1605         */
1606        @Override
1607        public void action( Dsmlv2Container container ) throws XmlPullParserException
1608        {
1609            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1610                container.getBatchRequest().getCurrentRequest();
1611
1612            XmlPullParser xpp = container.getParser();
1613
1614            AttributeValueAssertion assertion = new AttributeValueAssertion();
1615
1616            // Checking and adding the filter's attributes
1617            String attributeName = xpp.getAttributeValue( "", NAME );
1618
1619            if ( attributeName != null )
1620            {
1621                assertion.setAttributeDesc( attributeName );
1622            }
1623            else
1624            {
1625                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1626            }
1627
1628            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
1629                LdapCodecConstants.GREATER_OR_EQUAL_FILTER );
1630
1631            filter.setAssertion( assertion );
1632
1633            // Adding the filter to the Search Filter
1634            try
1635            {
1636                searchRequestDecorator.addCurrentFilter( filter );
1637            }
1638            catch ( DecoderException de )
1639            {
1640                throw new XmlPullParserException( de.getMessage(), xpp, de );
1641            }
1642
1643            searchRequestDecorator.setTerminalFilter( filter );
1644        }
1645    };
1646
1647    /**
1648     * GrammarAction that create a Less Or Equal Filter
1649     */
1650    private final GrammarAction lessOrEqualFilterCreation = new GrammarAction( "Create Less Or Equal Filter" )
1651    {
1652        /**
1653         * {@inheritDoc}
1654         */
1655        @Override
1656        public void action( Dsmlv2Container container ) throws XmlPullParserException
1657        {
1658            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1659                container.getBatchRequest().getCurrentRequest();
1660
1661            XmlPullParser xpp = container.getParser();
1662
1663            AttributeValueAssertion assertion = new AttributeValueAssertion();
1664
1665            // Checking and adding the filter's attributes
1666            String attributeValue;
1667            // name
1668            attributeValue = xpp.getAttributeValue( "", NAME );
1669
1670            if ( attributeValue != null )
1671            {
1672                assertion.setAttributeDesc( attributeValue );
1673            }
1674            else
1675            {
1676                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1677            }
1678
1679            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
1680                LdapCodecConstants.LESS_OR_EQUAL_FILTER );
1681
1682            filter.setAssertion( assertion );
1683
1684            // Adding the filter to the Search Filter
1685            try
1686            {
1687                searchRequestDecorator.addCurrentFilter( filter );
1688            }
1689            catch ( DecoderException de )
1690            {
1691                throw new XmlPullParserException( de.getMessage(), xpp, de );
1692            }
1693
1694            searchRequestDecorator.setTerminalFilter( filter );
1695        }
1696    };
1697
1698    /**
1699     * GrammarAction that create an Approx Match Filter
1700     */
1701    private final GrammarAction approxMatchFilterCreation = new GrammarAction( "Create Approx Match Filter" )
1702    {
1703        /**
1704         * {@inheritDoc}
1705         */
1706        @Override
1707        public void action( Dsmlv2Container container ) throws XmlPullParserException
1708        {
1709            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1710                container.getBatchRequest().getCurrentRequest();
1711
1712            XmlPullParser xpp = container.getParser();
1713
1714            AttributeValueAssertion assertion = new AttributeValueAssertion();
1715
1716            // Checking and adding the filter's attributes
1717            String attributeName = xpp.getAttributeValue( "", NAME );
1718
1719            if ( attributeName != null )
1720            {
1721                assertion.setAttributeDesc( attributeName );
1722            }
1723            else
1724            {
1725                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1726            }
1727
1728            AttributeValueAssertionFilter filter = new AttributeValueAssertionFilter(
1729                LdapCodecConstants.APPROX_MATCH_FILTER );
1730
1731            filter.setAssertion( assertion );
1732
1733            // Adding the filter to the Search Filter
1734            try
1735            {
1736                searchRequestDecorator.addCurrentFilter( filter );
1737            }
1738            catch ( DecoderException de )
1739            {
1740                throw new XmlPullParserException( de.getMessage(), xpp, de );
1741            }
1742
1743            searchRequestDecorator.setTerminalFilter( filter );
1744        }
1745    };
1746
1747    /**
1748     * GrammarAction that adds a Value to a Filter
1749     */
1750    private final GrammarAction filterAddValue = new GrammarAction( "Adds Value to Filter" )
1751    {
1752        /**
1753         * {@inheritDoc}
1754         */
1755        @Override
1756        public void action( Dsmlv2Container container ) throws XmlPullParserException
1757        {
1758            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1759                container.getBatchRequest().getCurrentRequest();
1760            AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequestDecorator
1761                .getTerminalFilter();
1762            AttributeValueAssertion assertion = filter.getAssertion();
1763
1764            XmlPullParser xpp = container.getParser();
1765
1766            try
1767            {
1768                // We have to catch the type Attribute Value before going to the next Text node
1769                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1770
1771                // Getting the value
1772                String nextText = xpp.nextText();
1773
1774                if ( !Strings.isEmpty( nextText ) )
1775                {
1776                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1777                    {
1778                        Value value = new Value( Base64.decode( nextText.trim().toCharArray() ) );
1779                        assertion.setAssertionValue( value );
1780                    }
1781                    else
1782                    {
1783                        Value value = new Value( nextText.trim() );
1784                        assertion.setAssertionValue( value );
1785                    }
1786                }
1787            }
1788            catch ( IOException ioe )
1789            {
1790                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1791            }
1792        }
1793    };
1794
1795    /**
1796     * GrammarAction that creates a Present Filter
1797     */
1798    private final GrammarAction presentFilterCreation = new GrammarAction( "Create Present Filter" )
1799    {
1800        /**
1801         * {@inheritDoc}
1802         */
1803        @Override
1804        public void action( Dsmlv2Container container ) throws XmlPullParserException
1805        {
1806            PresentFilter presentFilter = new PresentFilter();
1807
1808            XmlPullParser xpp = container.getParser();
1809
1810            // Adding the filter to the Search Filter
1811            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1812                container.getBatchRequest().getCurrentRequest();
1813
1814            try
1815            {
1816                searchRequestDecorator.addCurrentFilter( presentFilter );
1817            }
1818            catch ( DecoderException de )
1819            {
1820                throw new XmlPullParserException( de.getMessage(), xpp, de );
1821            }
1822
1823            // Checking and adding the filter's attributes
1824            String attributeValue;
1825            // name
1826            attributeValue = xpp.getAttributeValue( "", NAME );
1827
1828            if ( attributeValue != null )
1829            {
1830                presentFilter.setAttributeDescription( attributeValue );
1831            }
1832            else
1833            {
1834                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, null );
1835            }
1836        }
1837    };
1838
1839    /**
1840     * GrammarAction that store the Filter into the searchRequest
1841     */
1842    private final GrammarAction storeFilter = new GrammarAction( "Store Filter" )
1843    {
1844        /**
1845         * {@inheritDoc}
1846         */
1847        @Override
1848        public void action( Dsmlv2Container container ) throws XmlPullParserException
1849        {
1850            // Adding the filter to the Search Filter
1851            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1852                container.getBatchRequest().getCurrentRequest();
1853            SearchRequest searchRequest = searchRequestDecorator.getDecorated();
1854
1855            try
1856            {
1857                ExprNode exprNode = searchRequestDecorator.getFilterNode();
1858
1859                if ( exprNode == null )
1860                {
1861                    throw new IllegalStateException( I18n.err( I18n.ERR_03041_NO_FILTER_ELEMENT ) );
1862                }
1863
1864                searchRequest.setFilter( exprNode );
1865            }
1866            catch ( LdapSchemaException lse )
1867            {
1868
1869            }
1870        }
1871    };
1872
1873    /**
1874     * GrammarAction that creates an Extensible Match Filter
1875     */
1876    private final GrammarAction extensibleMatchFilterCreation = new GrammarAction( "Create Extensible Match Filter" )
1877    {
1878        /**
1879         * {@inheritDoc}
1880         */
1881        @Override
1882        public void action( Dsmlv2Container container ) throws XmlPullParserException
1883        {
1884            ExtensibleMatchFilter extensibleMatchFilter = new ExtensibleMatchFilter();
1885
1886            XmlPullParser xpp = container.getParser();
1887
1888            // Adding the filter to the Search Filter
1889            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1890                container.getBatchRequest().getCurrentRequest();
1891
1892            try
1893            {
1894                searchRequestDecorator.addCurrentFilter( extensibleMatchFilter );
1895            }
1896            catch ( DecoderException de )
1897            {
1898                throw new XmlPullParserException( I18n.err( I18n.ERR_03002_NAME_ATTRIBUTE_REQUIRED ), xpp, de );
1899            }
1900
1901            searchRequestDecorator.setTerminalFilter( extensibleMatchFilter );
1902
1903            // Checking and adding the filter's attributes
1904            String attributeValue;
1905            // dnAttributes
1906            attributeValue = xpp.getAttributeValue( "", "dnAttributes" );
1907
1908            if ( attributeValue != null )
1909            {
1910                if ( ( attributeValue.equals( TRUE ) ) || ( "1".equals( attributeValue ) ) )
1911                {
1912                    extensibleMatchFilter.setDnAttributes( true );
1913                }
1914                else if ( ( attributeValue.equals( FALSE ) ) || ( "0".equals( attributeValue ) ) )
1915                {
1916                    extensibleMatchFilter.setDnAttributes( false );
1917                }
1918                else
1919                {
1920                    throw new XmlPullParserException( I18n.err( I18n.ERR_03033_DN_ATTRIBUTES_NOT_BOOLEAN ), xpp, null );
1921                }
1922            }
1923            else
1924            {
1925                extensibleMatchFilter.setDnAttributes( false );
1926            }
1927
1928            // matchingRule
1929            attributeValue = xpp.getAttributeValue( "", "matchingRule" );
1930
1931            if ( attributeValue != null )
1932            {
1933                extensibleMatchFilter.setMatchingRule( attributeValue );
1934            }
1935
1936            // name
1937            attributeValue = xpp.getAttributeValue( "", NAME );
1938
1939            if ( attributeValue != null )
1940            {
1941                extensibleMatchFilter.setType( attributeValue );
1942            }
1943        }
1944    };
1945
1946    /**
1947     * GrammarAction that adds a Value to an Extensible Match Filter
1948     */
1949    private final GrammarAction extensibleMatchAddValue = new GrammarAction( "Adds Value to Extensible MatchFilter" )
1950    {
1951        /**
1952         * {@inheritDoc}
1953         */
1954        @Override
1955        public void action( Dsmlv2Container container ) throws XmlPullParserException
1956        {
1957            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
1958                container.getBatchRequest().getCurrentRequest();
1959            ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequestDecorator.getTerminalFilter();
1960
1961            XmlPullParser xpp = container.getParser();
1962
1963            try
1964            {
1965                // We have to catch the type Attribute Value before going to the next Text node
1966                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
1967
1968                // Getting the value
1969                String nextText = xpp.nextText();
1970
1971                if ( !Strings.isEmpty( nextText ) )
1972                {
1973                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
1974                    {
1975                        filter.setMatchValue( new Value( Base64.decode( nextText.trim().toCharArray() ) ) );
1976                    }
1977                    else
1978                    {
1979                        filter.setMatchValue( new Value( nextText.trim() ) );
1980                    }
1981                }
1982            }
1983            catch ( IOException ioe )
1984            {
1985                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
1986            }
1987        }
1988    };
1989
1990    /**
1991     * GrammarAction that creates a Control
1992     */
1993    private final GrammarAction controlCreation = new GrammarAction( "Create Control" )
1994    {
1995        /**
1996         * {@inheritDoc}
1997         */
1998        @Override
1999        public void action( Dsmlv2Container container ) throws XmlPullParserException
2000        {
2001            XmlPullParser xpp = container.getParser();
2002            Control control;
2003
2004            // Checking and adding the Control's attributes
2005            String attributeValue;
2006            
2007            // TYPE
2008            attributeValue = xpp.getAttributeValue( "", "type" );
2009
2010            if ( attributeValue != null )
2011            {
2012                if ( !Oid.isOid( attributeValue ) )
2013                {
2014                    throw new XmlPullParserException( I18n.err( I18n.ERR_03034_INCORRECT_TYPE_VALUE ), xpp, null );
2015                }
2016                
2017                ControlFactory<? extends Control> factory = codec.getRequestControlFactories().get( attributeValue );
2018                
2019                if ( factory == null )
2020                {
2021                    control = new OpaqueControl( attributeValue );
2022                }
2023                else
2024                {
2025                    control = factory.newControl();
2026                }
2027                
2028                ( ( Request ) container.getBatchRequest().getCurrentRequest() ).addControl( control );
2029            }
2030            else
2031            {
2032                throw new XmlPullParserException( I18n.err( I18n.ERR_03035_TYPE_ATTRIBUTE_REQUIRED ), xpp, null );
2033            }
2034
2035            // CRITICALITY
2036            attributeValue = xpp.getAttributeValue( "", "criticality" );
2037
2038            if ( attributeValue != null )
2039            {
2040                if ( attributeValue.equals( TRUE ) )
2041                {
2042                    control.setCritical( true );
2043                }
2044                else if ( attributeValue.equals( FALSE ) )
2045                {
2046                    control.setCritical( false );
2047                }
2048                else
2049                {
2050                    throw new XmlPullParserException( I18n.err( I18n.ERR_03007_INCORRECT_CRITICALITY_VALUE ), xpp, null );
2051                }
2052            }
2053        }
2054    };
2055
2056    /**
2057     * GrammarAction that adds a Value to a Control
2058     */
2059    private final GrammarAction controlValueCreation = new GrammarAction( "Add ControlValue to Control" )
2060    {
2061        /**
2062         * {@inheritDoc}
2063         */
2064        @Override
2065        public void action( Dsmlv2Container container ) throws XmlPullParserException
2066        {
2067            AbstractRequestDsml<? extends Request> request =
2068                ( AbstractRequestDsml<? extends Request> ) container.getBatchRequest().getCurrentRequest();
2069            DsmlControl<? extends Control> control = request.getCurrentControl();
2070
2071            XmlPullParser xpp = container.getParser();
2072
2073            try
2074            {
2075                // We have to catch the type Attribute Value before going to the next Text node
2076                String typeValue = ParserUtils.getXsiTypeAttributeValue( xpp );
2077
2078                // Getting the value
2079                String nextText = xpp.nextText();
2080
2081                if ( !Strings.isEmpty( nextText ) )
2082                {
2083                    if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
2084                    {
2085                        control.setValue( Base64.decode( nextText.trim().toCharArray() ) );
2086                    }
2087                    else
2088                    {
2089                        control.setValue( Strings.getBytesUtf8( nextText.trim() ) );
2090                    }
2091                }
2092            }
2093            catch ( IOException ioe )
2094            {
2095                throw new XmlPullParserException( I18n.err( I18n.ERR_03008_UNEXPECTED_ERROR, ioe.getMessage() ), xpp, ioe );
2096            }
2097        }
2098    };
2099
2100
2101    /**
2102     * Creates a new instance of Dsmlv2Grammar.
2103     */
2104    @SuppressWarnings("unchecked")
2105    public Dsmlv2Grammar()
2106    {
2107        name = Dsmlv2Grammar.class.getName();
2108
2109        // Create the transitions table
2110        super.transitions = ( HashMap<Tag, GrammarTransition>[] ) Array.newInstance( HashMap.class, 200 );
2111
2112        //====================================================
2113        //  Transitions concerning : BATCH REQUEST
2114        //====================================================
2115        super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()] = new HashMap<Tag, GrammarTransition>();
2116        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2117        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()] = new HashMap<Tag, GrammarTransition>();
2118        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2119
2120        // ** OPEN BATCH REQUEST **
2121        // State: [INIT_GRAMMAR_STATE] - Tag: <batchRequest>
2122        super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( BATCH_REQUEST, Tag.START ),
2123            new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
2124                batchRequestCreation ) );
2125
2126        // ** CLOSE BATCH REQUEST **
2127        // state: [BATCHREQUEST_START_TAG] - Tag: </batchRequest>
2128        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()]
2129            .put( new Tag( BATCH_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
2130                Dsmlv2StatesEnum.BATCHREQUEST_END_TAG, null ) );
2131        //state: [BATCHREQUEST_LOOP] - Tag: </batchRequest>
2132        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( BATCH_REQUEST, Tag.END ),
2133            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.GRAMMAR_END, null ) );
2134
2135        // ** ABANDON REQUEST **
2136        // State: [BATCHREQUEST_START_TAG] - Tag: <abandonRequest>
2137        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put(
2138            new Tag( ABANDON_REQUEST, Tag.START ),
2139            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
2140                abandonRequestCreation ) );
2141        // state: [BATCHREQUEST_LOOP] - Tag: <abandonRequest>
2142        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( ABANDON_REQUEST, Tag.START ),
2143            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
2144                abandonRequestCreation ) );
2145
2146        // ** ADD REQUEST **
2147        // state: [BATCHREQUEST_START_TAG] - Tag: <addRequest>
2148        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( ADD_REQUEST, Tag.START ),
2149            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
2150                addRequestCreation ) );
2151        // state: [BATCHREQUEST_LOOP] - Tag: <addRequest>
2152        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( ADD_REQUEST, Tag.START ),
2153            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
2154                addRequestCreation ) );
2155
2156        // ** AUTH REQUEST **
2157        // state: [BATCHREQUEST_START_TAG] - Tag: <authRequest>
2158        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( "authRequest", Tag.START ),
2159            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG,
2160                authRequestCreation ) );
2161
2162        // ** COMPARE REQUEST **
2163        // state: [BATCHREQUEST_START_TAG] - Tag: <compareRequest>
2164        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put(
2165            new Tag( COMPARE_REQUEST, Tag.START ),
2166            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
2167                compareRequestCreation ) );
2168        // state: [BATCHREQUEST_LOOP] - Tag: <compareRequest>
2169        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( COMPARE_REQUEST, Tag.START ),
2170            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
2171                compareRequestCreation ) );
2172
2173        // ** DEL REQUEST **
2174        // state: [BATCHREQUEST_START_TAG] - Tag: <delRequest>
2175        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( DEL_REQUEST, Tag.START ),
2176            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
2177                delRequestCreation ) );
2178        // state: [BATCHREQUEST_LOOP] - Tag: <delRequest>
2179        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( DEL_REQUEST, Tag.START ),
2180            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
2181                delRequestCreation ) );
2182
2183        // ** EXTENDED REQUEST **
2184        // state: [BATCHREQUEST_START_TAG] - Tag: <extendedRequest>
2185        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put(
2186            new Tag( EXTENDED_REQUEST, Tag.START ),
2187            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
2188                Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG, extendedRequestCreation ) );
2189        // state: [BATCHREQUEST_LOOP] - Tag: <extendedRequest>
2190        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( EXTENDED_REQUEST, Tag.START ),
2191            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
2192                extendedRequestCreation ) );
2193
2194        // ** MOD Dn REQUEST **
2195        // state: [BATCHREQUEST_START_TAG] - Tag: <modDNRequest>
2196        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put( new Tag( MOD_DN_REQUEST, Tag.START ),
2197            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
2198                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, modDNRequestCreation ) );
2199        // state: [BATCHREQUEST_LOOP] - Tag: <modDNRequest>
2200        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( MOD_DN_REQUEST, Tag.START ),
2201            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG,
2202                modDNRequestCreation ) );
2203
2204        // ** MODIFY REQUEST **
2205        // state: [BATCHREQUEST_START_TAG] - Tag: <modifyRequest>
2206        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put(
2207            new Tag( MODIFY_REQUEST, Tag.START ),
2208            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
2209                modifyRequestCreation ) );
2210        // state: [BATCHREQUEST_LOOP] - Tag: <modifyRequest>
2211        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( MODIFY_REQUEST, Tag.START ),
2212            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
2213                modifyRequestCreation ) );
2214
2215        // ** SEARCH REQUEST **
2216        // state: [BATCHREQUEST_START_TAG] - Tag: <searchRequest>
2217        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_START_TAG.ordinal()].put(
2218            new Tag( SEARCH_REQUEST, Tag.START ),
2219            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_START_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
2220                searchRequestCreation ) );
2221        // state: [BATCHREQUEST_LOOP] - Tag: <searchRequest>
2222        super.transitions[Dsmlv2StatesEnum.BATCHREQUEST_LOOP.ordinal()].put( new Tag( SEARCH_REQUEST, Tag.START ),
2223            new GrammarTransition( Dsmlv2StatesEnum.BATCHREQUEST_LOOP, Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
2224                searchRequestCreation ) );
2225
2226        //====================================================
2227        //  Transitions concerning : ABANDON REQUEST
2228        //====================================================
2229        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2230        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2231        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2232        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2233
2234        // State: [ABANDON_REQUEST_START_TAG] - Tag: </abandonRequest>
2235        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()]
2236            .put( new Tag( ABANDON_REQUEST, Tag.END ), new GrammarTransition(
2237                Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2238
2239        // State: [ABANDON_REQUEST_START_TAG] - Tag: <control>
2240        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2241            new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_START_TAG,
2242                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) );
2243
2244        // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2245        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()].put(
2246            new Tag( CONTROL_VALUE, Tag.START ), new GrammarTransition(
2247                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG,
2248                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2249
2250        // State: [ABANDON_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2251        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2252            Tag.END ),
2253            new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROLVALUE_END_TAG,
2254                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) );
2255
2256        // State: [ABANDON_REQUEST_CONTROL_START_TAG] - Tag: </control>
2257        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL,
2258            Tag.END ),
2259            new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG,
2260                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG, null ) );
2261
2262        // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: <control>
2263        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL,
2264            Tag.START ),
2265            new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG,
2266                Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_START_TAG, controlCreation ) );
2267
2268        // State: [ABANDON_REQUEST_CONTROL_END_TAG] - Tag: </abandonRequest>
2269        super.transitions[Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( ABANDON_REQUEST,
2270            Tag.END ),
2271            new GrammarTransition( Dsmlv2StatesEnum.ABANDON_REQUEST_CONTROL_END_TAG,
2272                Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2273
2274        //====================================================
2275        //  Transitions concerning : ADD REQUEST
2276        //====================================================
2277        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2278        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2279        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2280        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2281        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2282        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2283
2284        // state: [ADD_REQUEST_START_TAG] -> Tag: </addRequest>
2285        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( ADD_REQUEST, Tag.END ),
2286            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2287
2288        // State: [ADD_REQUEST_START_TAG] - Tag: <control>
2289        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2290            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG,
2291                Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) );
2292
2293        // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2294        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL_VALUE,
2295            Tag.START ),
2296            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG,
2297                Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2298
2299        // State: [ADD_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2300        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put(
2301            new Tag( CONTROL, Tag.END ),
2302            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROLVALUE_END_TAG,
2303                Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) );
2304
2305        // State: [ADD_REQUEST_CONTROL_START_TAG] - Tag: </control>
2306        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.END ),
2307            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG,
2308                Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, null ) );
2309
2310        // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: <control>
2311        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2312            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG,
2313                Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_START_TAG, controlCreation ) );
2314
2315        // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: </addRequest>
2316        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put(
2317            new Tag( ADD_REQUEST, Tag.END ),
2318            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2319                null ) );
2320
2321        // State: [ADD_REQUEST_START_TAG] - Tag: <attr>
2322        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_START_TAG.ordinal()].put( new Tag( ATTR, Tag.START ),
2323            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_START_TAG, Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
2324                addRequestAddAttribute ) );
2325
2326        // State: [ADD_REQUEST_CONTROL_END_TAG] - Tag: <attr>
2327        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( ATTR, Tag.START ),
2328            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_CONTROL_END_TAG,
2329                Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) );
2330
2331        // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: <attr>
2332        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()].put( new Tag( ATTR, Tag.START ),
2333            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG,
2334                Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddAttribute ) );
2335
2336        // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: </attr>
2337        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()].put( new Tag( ATTR, Tag.END ),
2338            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
2339                Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG, null ) );
2340
2341        // State: [ADD_REQUEST_ATTR_START_TAG] - Tag: <value>
2342        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG.ordinal()].put( new Tag( VALUE, Tag.START ),
2343            new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG,
2344                Dsmlv2StatesEnum.ADD_REQUEST_ATTR_START_TAG, addRequestAddValue ) );
2345
2346        // State: [ADD_REQUEST_ATTR_END_TAG] - Tag: </addRequest>
2347        super.transitions[Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG.ordinal()]
2348            .put( new Tag( ADD_REQUEST, Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.ADD_REQUEST_ATTR_END_TAG,
2349                Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2350
2351        //====================================================
2352        //  Transitions concerning : AUTH REQUEST
2353        //====================================================
2354        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2355        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2356        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2357        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2358
2359        // state: [AUTH_REQUEST_START_TAG] -> Tag: </authRequest>
2360        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()].put( new Tag( "authRequest", Tag.END ),
2361            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2362
2363        // State: [AUTH_REQUEST_START_TAG] - Tag: <control>
2364        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2365            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_START_TAG,
2366                Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) );
2367
2368        // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2369        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL_VALUE,
2370            Tag.START ),
2371            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG,
2372                Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2373
2374        // State: [AUTH_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2375        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2376            Tag.END ),
2377            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROLVALUE_END_TAG,
2378                Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) );
2379
2380        // State: [AUTH_REQUEST_CONTROL_START_TAG] - Tag: </control>
2381        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG.ordinal()].put(
2382            new Tag( CONTROL, Tag.END ),
2383            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG,
2384                Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, null ) );
2385
2386        // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: <control>
2387        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()].put(
2388            new Tag( CONTROL, Tag.START ),
2389            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG,
2390                Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_START_TAG, controlCreation ) );
2391
2392        // State: [AUTH_REQUEST_CONTROL_END_TAG] - Tag: </authRequest>
2393        super.transitions[Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG.ordinal()].put(
2394            new Tag( "authRequest", Tag.END ),
2395            new GrammarTransition( Dsmlv2StatesEnum.AUTH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2396                null ) );
2397
2398        //====================================================
2399        //  Transitions concerning : COMPARE REQUEST
2400        //====================================================
2401        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2402        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2403        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2404        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2405        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2406        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2407        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2408
2409        // State: [COMPARE_REQUEST_START_TAG] - Tag: <control>
2410        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2411            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG,
2412                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) );
2413
2414        // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2415        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()].put(
2416            new Tag( CONTROL_VALUE, Tag.START ), new GrammarTransition(
2417                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
2418                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2419
2420        // State: [COMPARE_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2421        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2422            Tag.END ),
2423            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROLVALUE_END_TAG,
2424                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) );
2425
2426        // State: [COMPARE_REQUEST_CONTROL_START_TAG] - Tag: </control>
2427        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL,
2428            Tag.END ),
2429            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
2430                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG, null ) );
2431
2432        // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: <control>
2433        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL,
2434            Tag.START ),
2435            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
2436                Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG, controlCreation ) );
2437
2438        // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: </compareRequest>
2439        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( COMPARE_REQUEST,
2440            Tag.END ),
2441            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
2442                Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2443
2444        // State: [COMPARE_REQUEST_START_TAG] - Tag: <assertion>
2445        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_START_TAG.ordinal()].put( new Tag( "assertion", Tag.START ),
2446            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_START_TAG,
2447                Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) );
2448
2449        // State: [COMPARE_REQUEST_CONTROL_END_TAG] - Tag: <assertion>
2450        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( "assertion",
2451            Tag.START ),
2452            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_CONTROL_END_TAG,
2453                Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG, compareRequestAddAssertion ) );
2454
2455        // State: [COMPARE_REQUEST_ASSERTION_START_TAG] - Tag: <value>
2456        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG.ordinal()].put( new Tag( VALUE,
2457            Tag.START ),
2458            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_START_TAG,
2459                Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG, compareRequestAddValue ) );
2460
2461        //State: [COMPARE_REQUEST_VALUE_END_TAG] - Tag: </assertion>
2462        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG.ordinal()].put(
2463            new Tag( "assertion", Tag.END ),
2464            new GrammarTransition( Dsmlv2StatesEnum.COMPARE_REQUEST_VALUE_END_TAG,
2465                Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, null ) );
2466
2467        // State: [COMPARE_REQUEST_ASSERTION_END_TAG] - Tag: </compareRequest>
2468        super.transitions[Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG.ordinal()].put(
2469            new Tag( COMPARE_REQUEST, Tag.END ), new GrammarTransition(
2470                Dsmlv2StatesEnum.COMPARE_REQUEST_ASSERTION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2471
2472        //====================================================
2473        //  Transitions concerning : DEL REQUEST
2474        //====================================================
2475        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2476        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2477        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2478        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2479
2480        // State: [DEL_REQUEST_START_TAG] - Tag: </delRequest>
2481        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()].put( new Tag( DEL_REQUEST, Tag.END ),
2482            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2483
2484        // State: [DEL_REQUEST_START_TAG] - Tag: <control>
2485        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2486            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_START_TAG,
2487                Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) );
2488
2489        // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2490        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL_VALUE,
2491            Tag.START ),
2492            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG,
2493                Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2494
2495        // State: [DEL_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2496        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put(
2497            new Tag( CONTROL, Tag.END ),
2498            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROLVALUE_END_TAG,
2499                Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) );
2500
2501        // State: [DEL_REQUEST_CONTROL_START_TAG] - Tag: </control>
2502        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.END ),
2503            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG,
2504                Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, null ) );
2505
2506        // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: <control>
2507        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2508            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG,
2509                Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_START_TAG, controlCreation ) );
2510
2511        // State: [DEL_REQUEST_CONTROL_END_TAG] - Tag: </delRequest>
2512        super.transitions[Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG.ordinal()].put(
2513            new Tag( DEL_REQUEST, Tag.END ),
2514            new GrammarTransition( Dsmlv2StatesEnum.DEL_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2515                null ) );
2516
2517        //====================================================
2518        //  Transitions concerning : EXTENDED REQUEST
2519        //====================================================
2520        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2521        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2522        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2523        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2524        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2525        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2526
2527        // State: [EXTENDED_REQUEST_START_TAG] - Tag: <control>
2528        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2529            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
2530                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) );
2531
2532        // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2533        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()].put(
2534            new Tag( CONTROL_VALUE, Tag.START ), new GrammarTransition(
2535                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG,
2536                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2537
2538        // State: [EXTENDED_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2539        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2540            Tag.END ),
2541            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROLVALUE_END_TAG,
2542                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) );
2543
2544        // State: [EXTENDED_REQUEST_CONTROL_START_TAG] - Tag: </control>
2545        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL,
2546            Tag.END ),
2547            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG,
2548                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, null ) );
2549
2550        // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: <control>
2551        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL,
2552            Tag.START ),
2553            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG,
2554                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_START_TAG, controlCreation ) );
2555
2556        // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: </extendedRequest>
2557        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put(
2558            new Tag( EXTENDED_REQUEST, Tag.END ), new GrammarTransition(
2559                Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2560
2561        // State: [EXTENDED_REQUEST_START_TAG] - Tag: <requestName>
2562        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG.ordinal()].put(
2563            new Tag( "requestName", Tag.START ),
2564            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_START_TAG,
2565                Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) );
2566
2567        // State: [EXTENDED_REQUEST_CONTROL_END_TAG] - Tag: <requestName>
2568        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( "requestName",
2569            Tag.START ),
2570            new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_CONTROL_END_TAG,
2571                Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG, extendedRequestAddName ) );
2572
2573        // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: </extendedRequest>
2574        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()].put( new Tag(
2575            EXTENDED_REQUEST,
2576            Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG,
2577            Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2578
2579        // State: [EXTENDED_REQUEST_REQUESTNAME_END_TAG] - Tag: <requestValue>
2580        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG.ordinal()].put( new Tag(
2581            "requestValue",
2582            Tag.START ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTNAME_END_TAG,
2583            Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG, extendedRequestAddValue ) );
2584
2585        // State: [EXTENDED_REQUEST_REQUESTVALUE_END_TAG] - Tag: </requestRequest>
2586        super.transitions[Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG.ordinal()].put( new Tag(
2587            EXTENDED_REQUEST,
2588            Tag.END ), new GrammarTransition( Dsmlv2StatesEnum.EXTENDED_REQUEST_REQUESTVALUE_END_TAG,
2589            Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2590
2591        //====================================================
2592        //  Transitions concerning : MODIFY Dn REQUEST
2593        //====================================================
2594        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2595        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2596        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2597        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2598
2599        // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: </modDNRequest>
2600        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()].put(
2601            new Tag( MOD_DN_REQUEST, Tag.END ),
2602            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2603                null ) );
2604
2605        // State: [MODIFY_DN_REQUEST_START_TAG] - Tag: <control>
2606        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2607            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_START_TAG,
2608                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) );
2609
2610        // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2611        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()].put(
2612            new Tag( CONTROL_VALUE, Tag.START ), new GrammarTransition(
2613                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG,
2614                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2615
2616        // State: [MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2617        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2618            Tag.END ),
2619            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG,
2620                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) );
2621
2622        // State: [MODIFY_DN_REQUEST_CONTROL_START_TAG] - Tag: </control>
2623        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL,
2624            Tag.END ),
2625            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG,
2626                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG, null ) );
2627
2628        // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: <control>
2629        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( CONTROL,
2630            Tag.START ),
2631            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG,
2632                Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_START_TAG, controlCreation ) );
2633
2634        // State: [MODIFY_DN_REQUEST_CONTROL_END_TAG] - Tag: </modDNRequest>
2635        super.transitions[Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( MOD_DN_REQUEST,
2636            Tag.END ),
2637            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_DN_REQUEST_CONTROL_END_TAG,
2638                Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2639
2640        //====================================================
2641        //  Transitions concerning : MODIFY REQUEST
2642        //====================================================
2643        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2644        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2645        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2646        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2647        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2648        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2649        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2650
2651        // State: [MODIFY_REQUEST_START_TAG] - Tag: </modifyRequest>
2652        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()]
2653            .put( new Tag( MODIFY_REQUEST, Tag.END ), new GrammarTransition(
2654                Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2655
2656        // State: [MODIFY_REQUEST_START_TAG] - Tag: <control>
2657        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2658            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
2659                Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) );
2660
2661        // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2662        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL_VALUE,
2663            Tag.START ),
2664            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG,
2665                Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2666
2667        // State: [MODIFY_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2668        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2669            Tag.END ),
2670            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROLVALUE_END_TAG,
2671                Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) );
2672
2673        // State: [MODIFY_REQUEST_CONTROL_START_TAG] - Tag: </control>
2674        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG.ordinal()].put(
2675            new Tag( CONTROL, Tag.END ),
2676            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG,
2677                Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, null ) );
2678
2679        // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: <control>
2680        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put(
2681            new Tag( CONTROL, Tag.START ),
2682            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG,
2683                Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_START_TAG, controlCreation ) );
2684
2685        // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: </modifyRequest>
2686        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( MODIFY_REQUEST,
2687            Tag.END ),
2688            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2689                null ) );
2690
2691        // State: [MODIFY_REQUEST_CONTROL_END_TAG] - Tag: <modification>
2692        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( MODIFICATION,
2693            Tag.START ),
2694            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_CONTROL_END_TAG,
2695                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
2696
2697        // State: [MODIFY_REQUEST_START_TAG] - Tag: <modification>
2698        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG.ordinal()].put(
2699            new Tag( MODIFICATION, Tag.START ),
2700            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_START_TAG,
2701                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
2702
2703        // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: <modification>
2704        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()].put(
2705            new Tag( MODIFICATION, Tag.START ), new GrammarTransition(
2706                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG,
2707                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG, modifyRequestAddModification ) );
2708
2709        // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: </modification>
2710        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()].put(
2711            new Tag( MODIFICATION, Tag.END ), new GrammarTransition(
2712                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG,
2713                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) );
2714
2715        // State: [MODIFY_REQUEST_MODIFICATION_START_TAG] - Tag: <value>
2716        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG.ordinal()].put( new Tag( VALUE,
2717            Tag.START ),
2718            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_START_TAG,
2719                Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) );
2720
2721        // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: <value>
2722        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( VALUE, Tag.START ),
2723            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG,
2724                Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG, modifyRequestAddValue ) );
2725
2726        // State: [MODIFY_REQUEST_VALUE_END_TAG] - Tag: </modification>
2727        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( MODIFICATION,
2728            Tag.END ),
2729            new GrammarTransition( Dsmlv2StatesEnum.MODIFY_REQUEST_VALUE_END_TAG,
2730                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, null ) );
2731
2732        // State: [MODIFY_REQUEST_MODIFICATION_END_TAG] - Tag: </modifyRequest>
2733        super.transitions[Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG.ordinal()].put(
2734            new Tag( MODIFY_REQUEST, Tag.END ), new GrammarTransition(
2735                Dsmlv2StatesEnum.MODIFY_REQUEST_MODIFICATION_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP, null ) );
2736
2737        //====================================================
2738        //  Transitions concerning : SEARCH REQUEST
2739        //====================================================
2740        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2741        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2742        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2743        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2744        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2745        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2746        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2747        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2748
2749        // State: [SEARCH_REQUEST_START_TAG] - Tag: <control>
2750        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()].put( new Tag( CONTROL, Tag.START ),
2751            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
2752                Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) );
2753
2754        // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: <controlValue>
2755        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()].put( new Tag( CONTROL_VALUE,
2756            Tag.START ),
2757            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG,
2758                Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG, controlValueCreation ) );
2759
2760        // State: [SEARCH_REQUEST_CONTROLVALUE_END_TAG] - Tag: </control>
2761        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG.ordinal()].put( new Tag( CONTROL,
2762            Tag.END ),
2763            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROLVALUE_END_TAG,
2764                Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) );
2765
2766        // State: [SEARCH_REQUEST_CONTROL_START_TAG] - Tag: </control>
2767        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG.ordinal()].put(
2768            new Tag( CONTROL, Tag.END ),
2769            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG,
2770                Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, null ) );
2771
2772        // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: <control>
2773        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put(
2774            new Tag( CONTROL, Tag.START ),
2775            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG,
2776                Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_START_TAG, controlCreation ) );
2777
2778        // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: </searchRequest>
2779        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put( new Tag( SEARCH_REQUEST,
2780            Tag.END ),
2781            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
2782                storeFilter ) );
2783
2784        // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: </attributes>
2785        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()].put( new Tag( "attributes",
2786            Tag.END ),
2787            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG,
2788                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) );
2789
2790        // State: [SEARCH_REQUEST_ATTRIBUTES_START_TAG] - Tag: <attribute>
2791        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG.ordinal()].put( new Tag( "attribute",
2792            Tag.START ),
2793            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG,
2794                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) );
2795
2796        // State: [SEARCH_REQUEST_ATTRIBUTE_START_TAG] - Tag: </attribute>
2797        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG.ordinal()].put( new Tag( "attribute",
2798            Tag.END ),
2799            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG,
2800                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG, null ) );
2801
2802        // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: <attribute>
2803        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()].put( new Tag( "attribute",
2804            Tag.START ),
2805            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG,
2806                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_START_TAG, searchRequestAddAttribute ) );
2807
2808        // State: [SEARCH_REQUEST_ATTRIBUTE_END_TAG] - Tag: </attributes>
2809        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG.ordinal()].put( new Tag( "attributes",
2810            Tag.END ),
2811            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTE_END_TAG,
2812                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG, null ) );
2813
2814        // State: [SEARCH_REQUEST_ATTRIBUTES_END_TAG] - Tag: </searchRequest>
2815        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG.ordinal()].put( new Tag( SEARCH_REQUEST,
2816            Tag.END ),
2817            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_END_TAG,
2818                Dsmlv2StatesEnum.BATCHREQUEST_LOOP, storeFilter ) );
2819
2820        //====================================================
2821        //  Transitions concerning : FILTER
2822        //====================================================
2823        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2824        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2825        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()] = new HashMap<Tag, GrammarTransition>();
2826        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2827        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2828        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2829        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2830        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2831        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2832        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2833        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
2834
2835        // State: [SEARCH_REQUEST_START_TAG] - Tag: <filter>
2836        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG.ordinal()].put( new Tag( "filter", Tag.START ),
2837            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_START_TAG,
2838                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) );
2839
2840        // State: [SEARCH_REQUEST_CONTROL_END_TAG] - Tag: <filter>
2841        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG.ordinal()].put(
2842            new Tag( "filter", Tag.START ),
2843            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_CONTROL_END_TAG,
2844                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG, null ) );
2845
2846        //*** AND ***
2847        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <and>
2848        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "and", Tag.START ),
2849            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2850                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) );
2851
2852        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <and>
2853        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "and", Tag.START ),
2854            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2855                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, andFilterCreation ) );
2856
2857        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </and>
2858        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "and", Tag.END ),
2859            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2860                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
2861
2862        //*** OR ***
2863        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <or>
2864        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "or", Tag.START ),
2865            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2866                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) );
2867
2868        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <or>
2869        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "or", Tag.START ),
2870            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2871                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, orFilterCreation ) );
2872
2873        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </or>
2874        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "or", Tag.END ),
2875            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2876                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
2877
2878        //*** NOT ***
2879        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <not>
2880        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "not", Tag.START ),
2881            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2882                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) );
2883
2884        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <not>
2885        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "not", Tag.START ),
2886            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2887                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, notFilterCreation ) );
2888
2889        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </not>
2890        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "not", Tag.END ),
2891            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2892                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, connectorFilterClose ) );
2893
2894        //*** SUBSTRINGS ***
2895        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <substrings>
2896        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( SUBSTRINGS,
2897            Tag.START ),
2898            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2899                Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) );
2900
2901        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <substrings>
2902        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put(
2903            new Tag( SUBSTRINGS, Tag.START ),
2904            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2905                Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG, substringsFilterCreation ) );
2906
2907        //*** EQUALITY MATCH ***
2908        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <equalityMatch>
2909        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "equalityMatch",
2910            Tag.START ),
2911            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2912                Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) );
2913
2914        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <equalityMatch>
2915        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "equalityMatch",
2916            Tag.START ),
2917            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2918                Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG, equalityMatchFilterCreation ) );
2919
2920        // State: [SEARCH_REQUEST_EQUALITYMATCH_START_TAG] - Tag: <value>
2921        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG.ordinal()].put( new Tag( VALUE,
2922            Tag.START ),
2923            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_EQUALITYMATCH_START_TAG,
2924                Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
2925
2926        // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </equalityMatch>
2927        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( "equalityMatch",
2928            Tag.END ),
2929            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
2930                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
2931
2932        //*** GREATER OR EQUAL ***
2933        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <greaterOrEqual>
2934        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put(
2935            new Tag( "greaterOrEqual", Tag.START ), new GrammarTransition(
2936                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2937                Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) );
2938
2939        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <greaterOrEqual>
2940        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "greaterOrEqual",
2941            Tag.START ),
2942            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2943                Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG, greaterOrEqualFilterCreation ) );
2944
2945        // State: [SEARCH_REQUEST_GREATEROREQUAL_START_TAG] - Tag: <value>
2946        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG.ordinal()].put( new Tag( VALUE,
2947            Tag.START ),
2948            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_GREATEROREQUAL_START_TAG,
2949                Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
2950
2951        // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </greaterOrEqual>
2952        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put( new Tag( "greaterOrEqual",
2953            Tag.END ),
2954            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
2955                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
2956
2957        //*** LESS OR EQUAL ***
2958        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <lessOrEqual>
2959        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "lessOrEqual",
2960            Tag.START ),
2961            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2962                Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) );
2963
2964        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <lessOrEqual>
2965        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put(
2966            new Tag( "lessOrEqual", Tag.START ),
2967            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2968                Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG, lessOrEqualFilterCreation ) );
2969
2970        // State: [SEARCH_REQUEST_LESSOREQUAL_START_TAG] - Tag: <value>
2971        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG.ordinal()].put( new Tag( VALUE,
2972            Tag.START ),
2973            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_LESSOREQUAL_START_TAG,
2974                Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
2975
2976        // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </lessOrEqual>
2977        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put(
2978            new Tag( "lessOrEqual", Tag.END ),
2979            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
2980                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
2981
2982        //*** LESS OR EQUAL ***
2983        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <approxMatch>
2984        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "approxMatch",
2985            Tag.START ),
2986            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
2987                Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) );
2988
2989        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <approxMatch>
2990        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put(
2991            new Tag( "approxMatch", Tag.START ),
2992            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
2993                Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG, approxMatchFilterCreation ) );
2994
2995        // State: [SEARCH_REQUEST_APPROXMATCH_START_TAG] - Tag: <value>
2996        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG.ordinal()].put( new Tag( VALUE,
2997            Tag.START ),
2998            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_APPROXMATCH_START_TAG,
2999                Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG, filterAddValue ) );
3000
3001        // State: [SEARCH_REQUEST_VALUE_END_TAG] - Tag: </approxMatch>
3002        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG.ordinal()].put(
3003            new Tag( "approxMatch", Tag.END ),
3004            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_VALUE_END_TAG,
3005                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
3006
3007        //*** PRESENT ***
3008        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <present>
3009        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put( new Tag( "present",
3010            Tag.START ),
3011            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
3012                Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) );
3013
3014        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <present>
3015        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "present", Tag.START ),
3016            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
3017                Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG, presentFilterCreation ) );
3018
3019        // State: [SEARCH_REQUEST_PRESENT_START_TAG] - Tag: </present>
3020        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG.ordinal()].put(
3021            new Tag( "present", Tag.END ),
3022            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_PRESENT_START_TAG,
3023                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
3024
3025        //*** EXTENSIBLE MATCH ***
3026        // State: [SEARCH_REQUEST_FILTER_START_TAG] - Tag: <extensibleMatch>
3027        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG.ordinal()].put(
3028            new Tag( "extensibleMatch", Tag.START ), new GrammarTransition(
3029                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_START_TAG,
3030                Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) );
3031
3032        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: <extensibleMatch>
3033        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "extensibleMatch",
3034            Tag.START ),
3035            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
3036                Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG, extensibleMatchFilterCreation ) );
3037
3038        // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG] - Tag: <value>
3039        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG.ordinal()].put(
3040            new Tag( VALUE, Tag.START ), new GrammarTransition(
3041                Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG,
3042                Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, extensibleMatchAddValue ) );
3043
3044        // State: [SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG] - Tag: </extensibleMatch>
3045        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG.ordinal()].put( new Tag(
3046            "extensibleMatch", Tag.END ), new GrammarTransition(
3047            Dsmlv2StatesEnum.SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG, Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
3048            null ) );
3049
3050        //*** Filter (end) ***
3051        // State: [SEARCH_REQUEST_FILTER_LOOP] - Tag: </filter>
3052        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP.ordinal()].put( new Tag( "filter", Tag.END ),
3053            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP,
3054                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, null ) );
3055
3056        // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: <attributes>
3057        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()].put( new Tag( "attributes",
3058            Tag.START ),
3059            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG,
3060                Dsmlv2StatesEnum.SEARCH_REQUEST_ATTRIBUTES_START_TAG, null ) );
3061
3062        // State: [SEARCH_REQUEST_FILTER_END_TAG] - Tag: </searchRequest>
3063        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG.ordinal()].put( new Tag( SEARCH_REQUEST,
3064            Tag.END ),
3065            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_END_TAG, Dsmlv2StatesEnum.BATCHREQUEST_LOOP,
3066                storeFilter ) );
3067
3068        //====================================================
3069        //  Transitions concerning : SUBSTRING FILTER
3070        //====================================================
3071        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3072        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3073        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3074        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3075        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3076
3077        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: </substrings>
3078        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( SUBSTRINGS,
3079            Tag.END ),
3080            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
3081                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, null ) );
3082
3083        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <initial>
3084        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( "initial",
3085            Tag.START ),
3086            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
3087                Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG, substringsFilterSetInitial ) );
3088
3089        // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: <any>
3090        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put( new Tag( "any", Tag.START ),
3091            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
3092                Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
3093
3094        // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: <final>
3095        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put(
3096            new Tag( "final", Tag.START ),
3097            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
3098                Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
3099
3100        // State: [SEARCH_REQUEST_INITIAL_END_TAG] - Tag: </substrings>
3101        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG.ordinal()].put( new Tag( SUBSTRINGS,
3102            Tag.END ),
3103            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_INITIAL_END_TAG,
3104                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
3105
3106        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <any>
3107        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( "any",
3108            Tag.START ),
3109            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
3110                Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
3111
3112        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: </any>
3113        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( "any", Tag.START ),
3114            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
3115                Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG, substringsFilterAddAny ) );
3116
3117        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: <final>
3118        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( "final", Tag.START ),
3119            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
3120                Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
3121
3122        // State: [SEARCH_REQUEST_ANY_END_TAG] - Tag: </substrings>
3123        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG.ordinal()].put( new Tag( SUBSTRINGS, Tag.END ),
3124            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_ANY_END_TAG,
3125                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
3126
3127        // State: [SEARCH_REQUEST_SUBSTRINGS_START_TAG] - Tag: <final>
3128        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG.ordinal()].put( new Tag( "final",
3129            Tag.START ),
3130            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_SUBSTRINGS_START_TAG,
3131                Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG, substringsFilterSetFinal ) );
3132
3133        // State: [SEARCH_REQUEST_FINAL_END_TAG] - Tag: </substrings>
3134        super.transitions[Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG.ordinal()].put(
3135            new Tag( SUBSTRINGS, Tag.END ),
3136            new GrammarTransition( Dsmlv2StatesEnum.SEARCH_REQUEST_FINAL_END_TAG,
3137                Dsmlv2StatesEnum.SEARCH_REQUEST_FILTER_LOOP, substringsFilterClose ) );
3138
3139        //------------------------------------------ handle SOAP envelopes --------------------------
3140        super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3141        super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3142        super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3143        super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3144        super.transitions[Dsmlv2StatesEnum.SOAP_BODY_END_TAG.ordinal()] = new HashMap<Tag, GrammarTransition>();
3145
3146        super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()] = new HashMap<Tag, GrammarTransition>();
3147
3148        // State: [INIT_GRAMMAR_STATE] - Tag: <envelope>
3149        super.transitions[Dsmlv2StatesEnum.INIT_GRAMMAR_STATE.ordinal()].put( new Tag( "envelope", Tag.START ),
3150            new GrammarTransition( Dsmlv2StatesEnum.INIT_GRAMMAR_STATE, Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG,
3151                null ) );
3152
3153        // state: [SOAP_ENVELOPE_START_TAG] -> Tag: <header>
3154        super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()].put( new Tag( "header", Tag.START ),
3155            new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_START_TAG,
3156                ParserUtils.READ_SOAP_HEADER ) );
3157
3158        // state: [SOAP_HEADER_START_TAG] -> Tag: </header>
3159        super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_START_TAG.ordinal()]
3160            .put( new Tag( "header", Tag.END ),
3161                new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_START_TAG, Dsmlv2StatesEnum.SOAP_HEADER_END_TAG,
3162                    null ) );
3163
3164        // state: [SOAP_HEADER_END_TAG] -> Tag: <body>
3165        super.transitions[Dsmlv2StatesEnum.SOAP_HEADER_END_TAG.ordinal()].put( new Tag( "body", Tag.START ),
3166            new GrammarTransition( Dsmlv2StatesEnum.SOAP_HEADER_END_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG, null ) );
3167
3168        // state: [SOAP_BODY_START_TAG] -> Tag: <batchRequest>
3169        super.transitions[Dsmlv2StatesEnum.SOAP_BODY_START_TAG.ordinal()].put( new Tag( BATCH_REQUEST, Tag.START ),
3170            new GrammarTransition( Dsmlv2StatesEnum.SOAP_BODY_START_TAG, Dsmlv2StatesEnum.BATCHREQUEST_START_TAG,
3171                batchRequestCreation ) );
3172
3173        // the optional transition if no soap header is present
3174        // state: [SOAP_ENVELOPE_START_TAG] -> Tag: <body>
3175        super.transitions[Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG.ordinal()]
3176            .put( new Tag( "body", Tag.START ),
3177                new GrammarTransition( Dsmlv2StatesEnum.SOAP_ENVELOPE_START_TAG, Dsmlv2StatesEnum.SOAP_BODY_START_TAG,
3178                    null ) );
3179
3180        // the below two transitions are a bit unconventional, technically the container's state is set to GRAMMAR_END
3181        // when the </batchRequest> tag is encountered by the parser and the corresponding action gets executed but in
3182        // a SOAP envelop we still have two more end tags(</body> and </envelope>) are left so we set those corresponding
3183        // current and next transition states always to GRAMMAR_END
3184        super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( "body", Tag.END ),
3185            new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) );
3186
3187        super.transitions[Dsmlv2StatesEnum.GRAMMAR_END.ordinal()].put( new Tag( "envelope", Tag.END ),
3188            new GrammarTransition( Dsmlv2StatesEnum.GRAMMAR_END, Dsmlv2StatesEnum.GRAMMAR_END, null ) );
3189
3190        //------------------------------------------
3191
3192    } // End of the constructor
3193
3194
3195    /**
3196     * @return The LDAP codec service.
3197     */
3198    public LdapApiService getLdapCodecService()
3199    {
3200        return codec;
3201    }
3202}