directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1028571 [1/3] - in /directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2: ./ reponse/ request/
Date Fri, 29 Oct 2010 01:05:49 GMT
Author: felixk
Date: Fri Oct 29 01:05:49 2010
New Revision: 1028571

URL: http://svn.apache.org/viewvc?rev=1028571&view=rev
Log:
Partial fix DIRSHARED-64
Transform IStates and inherited interfaces/implementing classes to enums

Removed:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IStates.java
Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Container.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2StatesEnum.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/GrammarTransition.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java Fri Oct 29 01:05:49 2010
@@ -49,7 +49,7 @@ public abstract class AbstractGrammar im
     protected String name;
 
     /** The grammar's states */
-    protected IStates statesEnum;
+    protected Enum<Dsmlv2StatesEnum>[] statesEnum;
 
 
     /**
@@ -84,9 +84,9 @@ public abstract class AbstractGrammar im
      *            The current tag
      * @return A valid transition if any, or null.
      */
-    public GrammarTransition getTransition( int state, Tag tag )
+    public GrammarTransition getTransition( Enum<Dsmlv2StatesEnum> state, Tag tag )
     {
-        return transitions[state].get( tag );
+        return transitions[((Dsmlv2StatesEnum)state).getState()].get( tag );
     }
 
 
@@ -96,9 +96,9 @@ public abstract class AbstractGrammar im
      * @return 
      *      Returns the statesEnum.
      */
-    public IStates getStatesEnum()
+    public Enum<Dsmlv2StatesEnum>[] getStatesEnum()
     {
-        return statesEnum;
+        return Dsmlv2StatesEnum.values();
     }
 
 
@@ -108,7 +108,7 @@ public abstract class AbstractGrammar im
      * @param statesEnum
      *      The statesEnum to set.
      */
-    public void setStatesEnum( IStates statesEnum )
+    public void setStatesEnum( Enum<Dsmlv2StatesEnum>[] statesEnum )
     {
         this.statesEnum = statesEnum;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Container.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Container.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Container.java Fri Oct 29 01:05:49 2010
@@ -33,7 +33,7 @@ public interface Container
      * 
      * @return Returns the current grammar state
      */
-    int getState();
+    Enum<Dsmlv2StatesEnum> getState();
 
 
     /**
@@ -42,7 +42,7 @@ public interface Container
      * @param state
      *            The new state
      */
-    void setState( int state );
+    void setState( Enum<Dsmlv2StatesEnum> state );
 
 
     /**
@@ -50,7 +50,7 @@ public interface Container
      * 
      * @return Returns the transition from the previous state to the new state
      */
-    int getTransition();
+    Enum<Dsmlv2StatesEnum> getTransition();
 
 
     /**
@@ -59,12 +59,12 @@ public interface Container
      * @param transition
      *            The transition to set
      */
-    void setTransition( int transition );
+    void setTransition( Enum<Dsmlv2StatesEnum> transition );
 
 
     /**
      * @return Returns the states.
      */
-    IStates getStates();
+    Enum<Dsmlv2StatesEnum>[] getStates();
 
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java Fri Oct 29 01:05:49 2010
@@ -35,13 +35,13 @@ import org.xmlpull.v1.XmlPullParser;
 public class Dsmlv2Container implements Container
 {
     /** The current state of the decoding */
-    private int state;
+    private Enum<Dsmlv2StatesEnum> state;
 
     /** The current transition */
-    private int transition;
+    private Enum<Dsmlv2StatesEnum> transition;
 
     /** Store the different states for debug purpose */
-    private IStates states;
+    private Enum<Dsmlv2StatesEnum>[] states;
 
     /** The pool parser */
     private XmlPullParser parser;
@@ -134,7 +134,7 @@ public class Dsmlv2Container implements 
      * @return
      *      the current grammar state
      */
-    public int getState()
+    public Enum<Dsmlv2StatesEnum> getState()
     {
         return state;
     }
@@ -146,7 +146,7 @@ public class Dsmlv2Container implements 
      * @param state
      *      the new state
      */
-    public void setState( int state )
+    public void setState( Enum<Dsmlv2StatesEnum> state )
     {
         this.state = state;
     }
@@ -158,7 +158,7 @@ public class Dsmlv2Container implements 
      * @return
      *      the transition from the previous state to the new state
      */
-    public int getTransition()
+    public Enum<Dsmlv2StatesEnum> getTransition()
     {
         return transition;
     }
@@ -170,7 +170,7 @@ public class Dsmlv2Container implements 
      * @param transition
      *      the transition to set
      */
-    public void setTransition( int transition )
+    public void setTransition( Enum<Dsmlv2StatesEnum> transition )
     {
         this.transition = transition;
     }
@@ -184,7 +184,7 @@ public class Dsmlv2Container implements 
      */
     @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UWF_UNWRITTEN_FIELD",
         justification="it exists a setter for 'states'")
-    public IStates getStates()
+    public Enum<Dsmlv2StatesEnum>[] getStates()
     {
         return states;
     }
@@ -224,7 +224,7 @@ public class Dsmlv2Container implements 
      * @return
      *      a valid transition if any, or null.
      */
-    public GrammarTransition getTransition( int currentState, Tag currentTag )
+    public GrammarTransition getTransition( Enum<Dsmlv2StatesEnum> currentState, Tag currentTag )
     {
         return grammar.getTransition( currentState, currentTag );
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2StatesEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2StatesEnum.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2StatesEnum.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2StatesEnum.java Fri Oct 29 01:05:49 2010
@@ -24,790 +24,500 @@ package org.apache.directory.shared.dsml
 /**
  * This class store the Dsml grammar's constants. It is also used for debugging
  * purpose.
- * 
- * TODO: Should this class be an enum?
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class Dsmlv2StatesEnum implements IStates
+public enum Dsmlv2StatesEnum
 {
+    /** The initial state of every grammar */
+    INIT_GRAMMAR_STATE(0),
+
+    /** The ending state for every grammars */
+    GRAMMAR_END(-1),
+
+    /** The END_STATE */
+    END_STATE(-1),
+
     //====================================================
     //  <batchRequest> ... </batchRequest>
     //====================================================
     /** The &lt;batchRequest&gt; tag */
-    public static final int BATCHREQUEST_START_TAG = 104;
+    BATCHREQUEST_START_TAG(104),
 
-    public static final int BATCHREQUEST_LOOP = 105;
+    BATCHREQUEST_LOOP(105),
 
     /** The &lt;/batchRequest&gt; tag */
-    public static final int BATCHREQUEST_END_TAG = 1;
+    BATCHREQUEST_END_TAG(1),
 
     //====================================================
     //  <abandonRequest> ... </abandonRequest>
     //====================================================
     /** The &lt;abandonRequest&gt; tag */
-    public static final int ABANDON_REQUEST_START_TAG = 2;
+    ABANDON_REQUEST_START_TAG(2),
 
     /** The &lt;control&gt; tag */
-    public static final int ABANDON_REQUEST_CONTROL_START_TAG = 4;
+    ABANDON_REQUEST_CONTROL_START_TAG(4),
 
     /** The &lt;/control&gt; tag */
-    public static final int ABANDON_REQUEST_CONTROL_END_TAG = 5;
+    ABANDON_REQUEST_CONTROL_END_TAG(5),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int ABANDON_REQUEST_CONTROLVALUE_START_TAG = 6;
+    ABANDON_REQUEST_CONTROLVALUE_START_TAG(6),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int ABANDON_REQUEST_CONTROLVALUE_END_TAG = 7;
+    ABANDON_REQUEST_CONTROLVALUE_END_TAG(7),
 
     //====================================================
     //  <addRequest> ... </addRequest>
     //====================================================
     /** The &lt;addRequest&gt; tag */
-    public static final int ADD_REQUEST_START_TAG = 8;
+    ADD_REQUEST_START_TAG(8),
 
     /** The &lt;control&gt; tag */
-    public static final int ADD_REQUEST_CONTROL_START_TAG = 10;
+    ADD_REQUEST_CONTROL_START_TAG(10),
 
     /** The &lt;/control&gt; tag */
-    public static final int ADD_REQUEST_CONTROL_END_TAG = 11;
+    ADD_REQUEST_CONTROL_END_TAG(11),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int ADD_REQUEST_CONTROLVALUE_START_TAG = 12;
+    ADD_REQUEST_CONTROLVALUE_START_TAG(12),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int ADD_REQUEST_CONTROLVALUE_END_TAG = 13;
+    ADD_REQUEST_CONTROLVALUE_END_TAG(13),
 
     /** The &lt;attr&gt; tag */
-    public static final int ADD_REQUEST_ATTR_START_TAG = 14;
+    ADD_REQUEST_ATTR_START_TAG(14),
 
     /** The &lt;/attr&gt; tag */
-    public static final int ADD_REQUEST_ATTR_END_TAG = 15;
+    ADD_REQUEST_ATTR_END_TAG(15),
 
     /** The &lt;value&gt; tag */
-    public static final int ADD_REQUEST_VALUE_START_TAG = 16;
+    ADD_REQUEST_VALUE_START_TAG(16),
 
     /** The &lt;/value&gt; tag */
-    public static final int ADD_REQUEST_VALUE_END_TAG = 17;
+    ADD_REQUEST_VALUE_END_TAG(17),
 
     //====================================================
     //  <authRequest> ... </authRequest>
     //====================================================
     /** The &lt;authRequest&gt; tag */
-    public static final int AUTH_REQUEST_START_TAG = 18;
+    AUTH_REQUEST_START_TAG(18),
 
     /** The &lt;control&gt; tag */
-    public static final int AUTH_REQUEST_CONTROL_START_TAG = 20;
+    AUTH_REQUEST_CONTROL_START_TAG(20),
 
     /** The &lt;/control&gt; tag */
-    public static final int AUTH_REQUEST_CONTROL_END_TAG = 21;
+    AUTH_REQUEST_CONTROL_END_TAG(21),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int AUTH_REQUEST_CONTROLVALUE_START_TAG = 22;
+    AUTH_REQUEST_CONTROLVALUE_START_TAG(22),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int AUTH_REQUEST_CONTROLVALUE_END_TAG = 23;
+    AUTH_REQUEST_CONTROLVALUE_END_TAG(23),
 
     //====================================================
     //  <compareRequest> ... </compareRequest>
     //====================================================
     /** The &lt;compareRequest&gt; tag */
-    public static final int COMPARE_REQUEST_START_TAG = 24;
+    COMPARE_REQUEST_START_TAG(24),
 
     /** The &lt;control&gt; tag */
-    public static final int COMPARE_REQUEST_CONTROL_START_TAG = 26;
+    COMPARE_REQUEST_CONTROL_START_TAG(26),
 
     /** The &lt;/control&gt; tag */
-    public static final int COMPARE_REQUEST_CONTROL_END_TAG = 27;
+    COMPARE_REQUEST_CONTROL_END_TAG(27),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int COMPARE_REQUEST_CONTROLVALUE_START_TAG = 28;
+    COMPARE_REQUEST_CONTROLVALUE_START_TAG(28),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int COMPARE_REQUEST_CONTROLVALUE_END_TAG = 29;
+    COMPARE_REQUEST_CONTROLVALUE_END_TAG(29),
 
     /** The &lt;assertion&gt; tag */
-    public static final int COMPARE_REQUEST_ASSERTION_START_TAG = 30;
+    COMPARE_REQUEST_ASSERTION_START_TAG(30),
 
     /** The &lt;/assertion&gt; tag */
-    public static final int COMPARE_REQUEST_ASSERTION_END_TAG = 31;
+    COMPARE_REQUEST_ASSERTION_END_TAG(31),
 
     /** The &lt;value&gt; tag */
-    public static final int COMPARE_REQUEST_VALUE_START_TAG = 32;
+    COMPARE_REQUEST_VALUE_START_TAG(32),
 
     /** The &lt;/value&gt; tag */
-    public static final int COMPARE_REQUEST_VALUE_END_TAG = 33;
+    COMPARE_REQUEST_VALUE_END_TAG(33),
 
     //====================================================
     //  <delRequest> ... </delRequest>
     //====================================================
     /** The &lt;delRequest&gt; tag */
-    public static final int DEL_REQUEST_START_TAG = 34;
+    DEL_REQUEST_START_TAG(34),
 
     /** The &lt;control&gt; tag */
-    public static final int DEL_REQUEST_CONTROL_START_TAG = 36;
+    DEL_REQUEST_CONTROL_START_TAG(36),
 
     /** The &lt;/control&gt; tag */
-    public static final int DEL_REQUEST_CONTROL_END_TAG = 37;
+    DEL_REQUEST_CONTROL_END_TAG(37),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int DEL_REQUEST_CONTROLVALUE_START_TAG = 38;
+    DEL_REQUEST_CONTROLVALUE_START_TAG(38),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int DEL_REQUEST_CONTROLVALUE_END_TAG = 39;
+    DEL_REQUEST_CONTROLVALUE_END_TAG(39),
 
     //====================================================
     //  <extendedRequest> ... </extendedRequest>
     //====================================================
     /** The &lt;extendedRequest&gt; tag */
-    public static final int EXTENDED_REQUEST_START_TAG = 40;
+    EXTENDED_REQUEST_START_TAG(40),
 
     /** The &lt;control&gt; tag */
-    public static final int EXTENDED_REQUEST_CONTROL_START_TAG = 42;
+    EXTENDED_REQUEST_CONTROL_START_TAG(42),
 
     /** The &lt;/control&gt; tag */
-    public static final int EXTENDED_REQUEST_CONTROL_END_TAG = 43;
+    EXTENDED_REQUEST_CONTROL_END_TAG(43),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int EXTENDED_REQUEST_CONTROLVALUE_START_TAG = 44;
+    EXTENDED_REQUEST_CONTROLVALUE_START_TAG(44),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int EXTENDED_REQUEST_CONTROLVALUE_END_TAG = 45;
+    EXTENDED_REQUEST_CONTROLVALUE_END_TAG(45),
 
     /** The &lt;requestName&gt; tag */
-    public static final int EXTENDED_REQUEST_REQUESTNAME_START_TAG = 46;
+    EXTENDED_REQUEST_REQUESTNAME_START_TAG(46),
 
     /** The &lt;/requestName&gt; tag */
-    public static final int EXTENDED_REQUEST_REQUESTNAME_END_TAG = 47;
+    EXTENDED_REQUEST_REQUESTNAME_END_TAG(47),
 
     /** The &lt;requestValue&gt; tag */
-    public static final int EXTENDED_REQUEST_REQUESTVALUE_START_TAG = 48;
+    EXTENDED_REQUEST_REQUESTVALUE_START_TAG(48),
 
     /** The &lt;/requestValue&gt; tag */
-    public static final int EXTENDED_REQUEST_REQUESTVALUE_END_TAG = 49;
+    EXTENDED_REQUEST_REQUESTVALUE_END_TAG(49),
 
     //====================================================
     //  <modDNRequest> ... </modDNRequest>
     //====================================================
     /** The &lt;modDNRequest&gt; tag */
-    public static final int MODIFY_DN_REQUEST_START_TAG = 50;
+    MODIFY_DN_REQUEST_START_TAG(50),
 
     /** The &lt;control&gt; tag */
-    public static final int MODIFY_DN_REQUEST_CONTROL_START_TAG = 52;
+    MODIFY_DN_REQUEST_CONTROL_START_TAG(52),
 
     /** The &lt;/control&gt; tag */
-    public static final int MODIFY_DN_REQUEST_CONTROL_END_TAG = 53;
+    MODIFY_DN_REQUEST_CONTROL_END_TAG(53),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int MODIFY_DN_REQUEST_CONTROLVALUE_START_TAG = 54;
+    MODIFY_DN_REQUEST_CONTROLVALUE_START_TAG(54),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG = 55;
+    MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG(55),
 
     //====================================================
     //  <modifyRequest> ... </modifyRequest>
     //====================================================
     /** The &lt;modifyRequest&gt; tag */
-    public static final int MODIFY_REQUEST_START_TAG = 56;
+    MODIFY_REQUEST_START_TAG(56),
 
     /** The &lt;control&gt; tag */
-    public static final int MODIFY_REQUEST_CONTROL_START_TAG = 58;
+    MODIFY_REQUEST_CONTROL_START_TAG(58),
 
     /** The &lt;/control&gt; tag */
-    public static final int MODIFY_REQUEST_CONTROL_END_TAG = 59;
+    MODIFY_REQUEST_CONTROL_END_TAG(59),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int MODIFY_REQUEST_CONTROLVALUE_START_TAG = 60;
+    MODIFY_REQUEST_CONTROLVALUE_START_TAG(60),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int MODIFY_REQUEST_CONTROLVALUE_END_TAG = 61;
+    MODIFY_REQUEST_CONTROLVALUE_END_TAG(61),
 
     /** The &lt;modification&gt; tag */
-    public static final int MODIFY_REQUEST_MODIFICATION_START_TAG = 62;
+    MODIFY_REQUEST_MODIFICATION_START_TAG(62),
 
     /** The &lt;/modification&gt; tag */
-    public static final int MODIFY_REQUEST_MODIFICATION_END_TAG = 63;
+    MODIFY_REQUEST_MODIFICATION_END_TAG(63),
 
     /** The &lt;value&gt; tag */
-    public static final int MODIFY_REQUEST_VALUE_START_TAG = 64;
+    MODIFY_REQUEST_VALUE_START_TAG(64),
 
     /** The &lt;/value&gt; tag */
-    public static final int MODIFY_REQUEST_VALUE_END_TAG = 65;
+    MODIFY_REQUEST_VALUE_END_TAG(65),
 
     //====================================================
     //  <searchRequest> ... </searchRequest>
     //====================================================
     /** The &lt;searchRequest&gt; tag */
-    public static final int SEARCH_REQUEST_START_TAG = 66;
+    SEARCH_REQUEST_START_TAG(66),
 
     /** The &lt;control&gt; tag */
-    public static final int SEARCH_REQUEST_CONTROL_START_TAG = 68;
+    SEARCH_REQUEST_CONTROL_START_TAG(68),
 
     /** The &lt;/control&gt; tag */
-    public static final int SEARCH_REQUEST_CONTROL_END_TAG = 69;
+    SEARCH_REQUEST_CONTROL_END_TAG(69),
 
     /** The &lt;controlValue&gt; tag */
-    public static final int SEARCH_REQUEST_CONTROLVALUE_START_TAG = 70;
+    SEARCH_REQUEST_CONTROLVALUE_START_TAG(70),
 
     /** The &lt;/controlValue&gt; tag */
-    public static final int SEARCH_REQUEST_CONTROLVALUE_END_TAG = 71;
+    SEARCH_REQUEST_CONTROLVALUE_END_TAG(71),
 
     /** The &lt;filter&gt; tag */
-    public static final int SEARCH_REQUEST_FILTER_START_TAG = 72;
+    SEARCH_REQUEST_FILTER_START_TAG(72),
 
     /** The &lt;/filter&gt; tag */
-    public static final int SEARCH_REQUEST_FILTER_END_TAG = 73;
+    SEARCH_REQUEST_FILTER_END_TAG(73),
 
     /** The &lt;attributes&gt; tag */
-    public static final int SEARCH_REQUEST_ATTRIBUTES_START_TAG = 74;
+    SEARCH_REQUEST_ATTRIBUTES_START_TAG(74),
 
     /** The &lt;/attributes&gt; tag */
-    public static final int SEARCH_REQUEST_ATTRIBUTES_END_TAG = 75;
+    SEARCH_REQUEST_ATTRIBUTES_END_TAG(75),
 
     /** The &lt;attribute&gt; tag */
-    public static final int SEARCH_REQUEST_ATTRIBUTE_START_TAG = 76;
+    SEARCH_REQUEST_ATTRIBUTE_START_TAG(76),
 
     /** The &lt;/attribute&gt; tag */
-    public static final int SEARCH_REQUEST_ATTRIBUTE_END_TAG = 77;
+    SEARCH_REQUEST_ATTRIBUTE_END_TAG(77),
 
     /** The &lt;equalityMatch&gt; tag */
-    public static final int SEARCH_REQUEST_EQUALITYMATCH_START_TAG = 84;
+    SEARCH_REQUEST_EQUALITYMATCH_START_TAG(84),
 
     /** The &lt;subStrings&gt; tag */
-    public static final int SEARCH_REQUEST_SUBSTRINGS_START_TAG = 86;
+    SEARCH_REQUEST_SUBSTRINGS_START_TAG(86),
 
     /** The &lt;/subStrings&gt; tag */
-    public static final int SEARCH_REQUEST_SUBSTRINGS_END_TAG = 87;
+    SEARCH_REQUEST_SUBSTRINGS_END_TAG(87),
 
     /** The &lt;greaterOrEqual&gt; tag */
-    public static final int SEARCH_REQUEST_GREATEROREQUAL_START_TAG = 88;
+    SEARCH_REQUEST_GREATEROREQUAL_START_TAG(88),
 
     /** The &lt;lessOrEqual&gt; tag */
-    public static final int SEARCH_REQUEST_LESSOREQUAL_START_TAG = 90;
+    SEARCH_REQUEST_LESSOREQUAL_START_TAG(90),
 
     /** The &lt;present&gt; tag */
-    public static final int SEARCH_REQUEST_PRESENT_START_TAG = 92;
+    SEARCH_REQUEST_PRESENT_START_TAG(92),
 
     /** The &lt;approxMatch&gt; tag */
-    public static final int SEARCH_REQUEST_APPROXMATCH_START_TAG = 94;
+    SEARCH_REQUEST_APPROXMATCH_START_TAG(94),
 
     /** The &lt;extensibleMatch&gt; tag */
-    public static final int SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG = 96;
+    SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG(96),
 
     /** The &lt;value&gt; tag */
-    public static final int SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_START_TAG = 109;
+    SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_START_TAG(109),
 
     /** The &lt;/value&gt; tag */
-    public static final int SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG = 110;
+    SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG(110),
 
     /** The &lt;initial&gt; tag */
-    public static final int SEARCH_REQUEST_INITIAL_START_TAG = 98;
+    SEARCH_REQUEST_INITIAL_START_TAG(98),
 
     /** The &lt;/initial&gt; tag */
-    public static final int SEARCH_REQUEST_INITIAL_END_TAG = 99;
+    SEARCH_REQUEST_INITIAL_END_TAG(99),
 
     /** The &lt;any&gt; tag */
-    public static final int SEARCH_REQUEST_ANY_START_TAG = 100;
+    SEARCH_REQUEST_ANY_START_TAG(100),
 
     /** The &lt;/any&gt; tag */
-    public static final int SEARCH_REQUEST_ANY_END_TAG = 101;
+    SEARCH_REQUEST_ANY_END_TAG(101),
 
     /** The &lt;final&gt; tag */
-    public static final int SEARCH_REQUEST_FINAL_START_TAG = 102;
+    SEARCH_REQUEST_FINAL_START_TAG(102),
 
     /** The &lt;/final&gt; tag */
-    public static final int SEARCH_REQUEST_FINAL_END_TAG = 103;
+    SEARCH_REQUEST_FINAL_END_TAG(103),
 
     /** The &lt;value&gt; tag */
-    public static final int SEARCH_REQUEST_VALUE_START_TAG = 107;
+    SEARCH_REQUEST_VALUE_START_TAG(107),
 
     /** The &lt;/value&gt; tag */
-    public static final int SEARCH_REQUEST_VALUE_END_TAG = 108;
+    SEARCH_REQUEST_VALUE_END_TAG(108),
 
     /** The Filter Loop state */
-    public static final int SEARCH_REQUEST_FILTER_LOOP = 106;
+    SEARCH_REQUEST_FILTER_LOOP(106),
 
     //****************
     // DSML Response 
     //****************
 
     /** The Batch Response Loop state */
-    public static final int BATCH_RESPONSE_LOOP = 200;
+    BATCH_RESPONSE_LOOP(200),
 
     /** The Error Response Loop state */
-    public static final int ERROR_RESPONSE = 201;
+    ERROR_RESPONSE(201),
 
     /** The Message Start state */
-    public static final int MESSAGE_START = 202;
+    MESSAGE_START(202),
 
     /** The Message End state */
-    public static final int MESSAGE_END = 203;
+    MESSAGE_END(203),
 
     /** The Detail Start state */
-    public static final int DETAIL_START = 204;
+    DETAIL_START(204),
 
     /** The Detail End state */
-    public static final int DETAIL_END = 205;
+    DETAIL_END(205),
 
     /** The Extended Response state */
-    public static final int EXTENDED_RESPONSE = 206;
+    EXTENDED_RESPONSE(206),
 
     /** The Extended Response Control Start state */
-    public static final int EXTENDED_RESPONSE_CONTROL_START = 207;
+    EXTENDED_RESPONSE_CONTROL_START(207),
 
     /** The Extended Response Control End state */
-    public static final int EXTENDED_RESPONSE_CONTROL_END = 208;
+    EXTENDED_RESPONSE_CONTROL_END(208),
 
     /** The Extended Response Control Value Start state */
-    public static final int EXTENDED_RESPONSE_CONTROL_VALUE_START = 245;
+    EXTENDED_RESPONSE_CONTROL_VALUE_START(245),
 
     /** The Extended Response Control Value End state */
-    public static final int EXTENDED_RESPONSE_CONTROL_VALUE_END = 246;
+    EXTENDED_RESPONSE_CONTROL_VALUE_END(246),
 
     /** The Extended Response Result Code Start state */
-    public static final int EXTENDED_RESPONSE_RESULT_CODE_START = 209;
+    EXTENDED_RESPONSE_RESULT_CODE_START(209),
 
     /** The Extended Response Result Code End state */
-    public static final int EXTENDED_RESPONSE_RESULT_CODE_END = 210;
+    EXTENDED_RESPONSE_RESULT_CODE_END(210),
 
     /** The Extended Response Error Message Start state */
-    public static final int EXTENDED_RESPONSE_ERROR_MESSAGE_START = 211;
+    EXTENDED_RESPONSE_ERROR_MESSAGE_START(211),
 
     /** The Extended Response Error Message End state */
-    public static final int EXTENDED_RESPONSE_ERROR_MESSAGE_END = 212;
+    EXTENDED_RESPONSE_ERROR_MESSAGE_END(212),
 
     /** The Extended Response Referral Start state */
-    public static final int EXTENDED_RESPONSE_REFERRAL_START = 213;
+    EXTENDED_RESPONSE_REFERRAL_START(213),
 
     /** The Extended Response Referral End state */
-    public static final int EXTENDED_RESPONSE_REFERRAL_END = 214;
+    EXTENDED_RESPONSE_REFERRAL_END(214),
 
     /** The Response Name Start state */
-    public static final int RESPONSE_NAME_START = 215;
+    RESPONSE_NAME_START(215),
 
     /** The Response Name End state */
-    public static final int RESPONSE_NAME_END = 216;
+    RESPONSE_NAME_END(216),
 
     /** The Response Start state */
-    public static final int RESPONSE_START = 217;
+    RESPONSE_START(217),
 
     /** The Response End state */
-    public static final int RESPONSE_END = 218;
+    RESPONSE_END(218),
 
     /** The LDAP Result state */
-    public static final int LDAP_RESULT = 219;
+    LDAP_RESULT(219),
 
     /** The LDAP Result Control Start state */
-    public static final int LDAP_RESULT_CONTROL_START = 220;
+    LDAP_RESULT_CONTROL_START(220),
 
     /** The LDAP Result Control End state */
-    public static final int LDAP_RESULT_CONTROL_END = 221;
+    LDAP_RESULT_CONTROL_END(221),
 
     /** The LDAP Result Control Value Start state */
-    public static final int LDAP_RESULT_CONTROL_VALUE_START = 247;
+    LDAP_RESULT_CONTROL_VALUE_START(247),
 
     /** The LDAP Result Control Value End state */
-    public static final int LDAP_RESULT_CONTROL_VALUE_END = 248;
+    LDAP_RESULT_CONTROL_VALUE_END(248),
 
     /** The LDAP Result Result Code Start state */
-    public static final int LDAP_RESULT_RESULT_CODE_START = 222;
+    LDAP_RESULT_RESULT_CODE_START(222),
 
     /** The LDAP Result Result Code End state */
-    public static final int LDAP_RESULT_RESULT_CODE_END = 223;
+    LDAP_RESULT_RESULT_CODE_END(223),
 
     /** The LDAP Result Error Message Start state */
-    public static final int LDAP_RESULT_ERROR_MESSAGE_START = 224;
+    LDAP_RESULT_ERROR_MESSAGE_START(224),
 
     /** The LDAP Result Error Message End state */
-    public static final int LDAP_RESULT_ERROR_MESSAGE_END = 225;
+    LDAP_RESULT_ERROR_MESSAGE_END(225),
 
     /** The LDAP Result Referral Start state */
-    public static final int LDAP_RESULT_REFERRAL_START = 226;
+    LDAP_RESULT_REFERRAL_START(226),
 
     /** The LDAP Result Referral End state */
-    public static final int LDAP_RESULT_REFERRAL_END = 227;
+    LDAP_RESULT_REFERRAL_END(227),
 
     /** The LDAP Result End state */
-    public static final int LDAP_RESULT_END = 228;
+    LDAP_RESULT_END(228),
 
     /** The Search Response state */
-    public static final int SEARCH_RESPONSE = 229;
+    SEARCH_RESPONSE(229),
 
     /** The Search Result Entry state */
-    public static final int SEARCH_RESULT_ENTRY = 230;
+    SEARCH_RESULT_ENTRY(230),
 
     /** The Search Result Entry Control Start state */
-    public static final int SEARCH_RESULT_ENTRY_CONTROL_START = 231;
+    SEARCH_RESULT_ENTRY_CONTROL_START(231),
 
     /** The Search Result Entry Control End state */
-    public static final int SEARCH_RESULT_ENTRY_CONTROL_END = 232;
+    SEARCH_RESULT_ENTRY_CONTROL_END(232),
 
     /** The Search Result Entry Control Value Start state */
-    public static final int SEARCH_RESULT_ENTRY_CONTROL_VALUE_START = 249;
+    SEARCH_RESULT_ENTRY_CONTROL_VALUE_START(249),
 
     /** The Search Result Entry Control Value End state */
-    public static final int SEARCH_RESULT_ENTRY_CONTROL_VALUE_END = 250;
+    SEARCH_RESULT_ENTRY_CONTROL_VALUE_END(250),
 
     /** The Search Result Entry Attr Start state */
-    public static final int SEARCH_RESULT_ENTRY_ATTR_START = 233;
+    SEARCH_RESULT_ENTRY_ATTR_START(233),
 
     /** The Search Result Entry Attr End state */
-    public static final int SEARCH_RESULT_ENTRY_ATTR_END = 234;
+    SEARCH_RESULT_ENTRY_ATTR_END(234),
 
     /** The Search Result Entry Value Start state */
-    public static final int SEARCH_RESULT_ENTRY_VALUE_START = 235;
+    SEARCH_RESULT_ENTRY_VALUE_START(235),
 
     /** The Search Result Entry Value End state */
-    public static final int SEARCH_RESULT_ENTRY_VALUE_END = 236;
+    SEARCH_RESULT_ENTRY_VALUE_END(236),
 
     /** The Search Result Entry Loop state */
-    public static final int SEARCH_RESULT_ENTRY_LOOP = 237;
+    SEARCH_RESULT_ENTRY_LOOP(237),
 
     /** The Search Result Reference state */
-    public static final int SEARCH_RESULT_REFERENCE = 238;
+    SEARCH_RESULT_REFERENCE(238),
 
     /** The Search Result Reference Control Start state */
-    public static final int SEARCH_RESULT_REFERENCE_CONTROL_START = 239;
+    SEARCH_RESULT_REFERENCE_CONTROL_START(239),
 
     /** The Search Result Reference Control End state */
-    public static final int SEARCH_RESULT_REFERENCE_CONTROL_END = 240;
+    SEARCH_RESULT_REFERENCE_CONTROL_END(240),
 
     /** The Search Result Reference Control Value Start state */
-    public static final int SEARCH_RESULT_REFERENCE_CONTROL_VALUE_START = 251;
+    SEARCH_RESULT_REFERENCE_CONTROL_VALUE_START(251),
 
     /** The Search Result Reference Control Value End state */
-    public static final int SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END = 252;
+    SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END(252),
 
     /** The Search Result Reference Ref Start state */
-    public static final int SEARCH_RESULT_REFERENCE_REF_START = 241;
+    SEARCH_RESULT_REFERENCE_REF_START(241),
 
     /** The Search Result Reference Ref End state */
-    public static final int SEARCH_RESULT_REFERENCE_REF_END = 242;
+    SEARCH_RESULT_REFERENCE_REF_END(242),
 
     /** The Search Result Reference Loop state */
-    public static final int SEARCH_RESULT_REFERENCE_LOOP = 243;
+    SEARCH_RESULT_REFERENCE_LOOP(243),
 
     /** The Search Result Done End state */
-    public static final int SEARCH_RESULT_DONE_END = 244;
-
-    /** The instance */
-    private static Dsmlv2StatesEnum instance = new Dsmlv2StatesEnum();
-
-
-    private Dsmlv2StatesEnum()
-    {
-    }
-
+    SEARCH_RESULT_DONE_END(244);
+    
+    private int state;
 
     /**
-     * Get an instance of this class
      * 
-     * @return An instance on this class
+     * Creates a new instance of Dsmlv2StatesEnum.
+     *
+     * @param state
      */
-    public static Dsmlv2StatesEnum getInstance()
+    Dsmlv2StatesEnum(int state)
     {
-        return instance;
+        this.state = state;
     }
 
-
     /**
-     * Get the current state for a specified grammar.
+     * 
+     * Get the state.
      *
-     * @param state the state
-     * @return the state
+     * @return State as integer value
      */
-    public String getState( int state )
+    public int getState()
     {
-        switch ( state )
-        {
-            case BATCHREQUEST_START_TAG:
-                return "BATCHREQUEST_START_TAG";
-            case BATCHREQUEST_LOOP:
-                return "BATCHREQUEST_LOOP";
-            case BATCHREQUEST_END_TAG:
-                return "BATCHREQUEST_END_TAG";
-            case ABANDON_REQUEST_START_TAG:
-                return "ABANDON_REQUEST_START_TAG";
-            case ABANDON_REQUEST_CONTROL_START_TAG:
-                return "ABANDON_REQUEST_CONTROL_START_TAG";
-            case ABANDON_REQUEST_CONTROL_END_TAG:
-                return "ABANDON_REQUEST_CONTROL_END_TAG";
-            case ABANDON_REQUEST_CONTROLVALUE_START_TAG:
-                return "ABANDON_REQUEST_CONTROLVALUE_START_TAG";
-            case ABANDON_REQUEST_CONTROLVALUE_END_TAG:
-                return "ABANDON_REQUEST_CONTROLVALUE_END_TAG";
-            case ADD_REQUEST_START_TAG:
-                return "ADD_REQUEST_START_TAG";
-            case ADD_REQUEST_CONTROL_START_TAG:
-                return "ADD_REQUEST_CONTROL_START_TAG";
-            case ADD_REQUEST_CONTROL_END_TAG:
-                return "ADD_REQUEST_CONTROL_END_TAG";
-            case ADD_REQUEST_CONTROLVALUE_START_TAG:
-                return "ADD_REQUEST_CONTROLVALUE_START_TAG";
-            case ADD_REQUEST_CONTROLVALUE_END_TAG:
-                return "ADD_REQUEST_CONTROLVALUE_END_TAG";
-            case ADD_REQUEST_ATTR_START_TAG:
-                return "ADD_REQUEST_ATTR_START_TAG";
-            case ADD_REQUEST_ATTR_END_TAG:
-                return "ADD_REQUEST_ATTR_END_TAG";
-            case ADD_REQUEST_VALUE_START_TAG:
-                return "ADD_REQUEST_VALUE_START_TAG";
-            case ADD_REQUEST_VALUE_END_TAG:
-                return "ADD_REQUEST_VALUE_END_TAG";
-            case AUTH_REQUEST_START_TAG:
-                return "AUTH_REQUEST_START_TAG";
-            case AUTH_REQUEST_CONTROL_START_TAG:
-                return "AUTH_REQUEST_CONTROL_START_TAG";
-            case AUTH_REQUEST_CONTROL_END_TAG:
-                return "AUTH_REQUEST_CONTROL_END_TAG";
-            case AUTH_REQUEST_CONTROLVALUE_START_TAG:
-                return "AUTH_REQUEST_CONTROLVALUE_START_TAG";
-            case AUTH_REQUEST_CONTROLVALUE_END_TAG:
-                return "AUTH_REQUEST_CONTROLVALUE_END_TAG";
-            case COMPARE_REQUEST_START_TAG:
-                return "COMPARE_REQUEST_START_TAG";
-            case COMPARE_REQUEST_CONTROL_START_TAG:
-                return "COMPARE_REQUEST_CONTROL_START_TAG";
-            case COMPARE_REQUEST_CONTROL_END_TAG:
-                return "COMPARE_REQUEST_CONTROL_END_TAG";
-            case COMPARE_REQUEST_CONTROLVALUE_START_TAG:
-                return "COMPARE_REQUEST_CONTROLVALUE_START_TAG";
-            case COMPARE_REQUEST_CONTROLVALUE_END_TAG:
-                return "COMPARE_REQUEST_CONTROLVALUE_END_TAG";
-            case COMPARE_REQUEST_ASSERTION_START_TAG:
-                return "COMPARE_REQUEST_ASSERTION_START_TAG";
-            case COMPARE_REQUEST_ASSERTION_END_TAG:
-                return "COMPARE_REQUEST_ASSERTION_END_TAG";
-            case COMPARE_REQUEST_VALUE_START_TAG:
-                return "COMPARE_REQUEST_VALUE_START_TAG";
-            case COMPARE_REQUEST_VALUE_END_TAG:
-                return "COMPARE_REQUEST_VALUE_END_TAG";
-            case DEL_REQUEST_START_TAG:
-                return "DEL_REQUEST_START_TAG";
-            case DEL_REQUEST_CONTROL_START_TAG:
-                return "DEL_REQUEST_CONTROL_START_TAG";
-            case DEL_REQUEST_CONTROL_END_TAG:
-                return "DEL_REQUEST_CONTROL_END_TAG";
-            case DEL_REQUEST_CONTROLVALUE_START_TAG:
-                return "DEL_REQUEST_CONTROLVALUE_START_TAG";
-            case DEL_REQUEST_CONTROLVALUE_END_TAG:
-                return "DEL_REQUEST_CONTROLVALUE_END_TAG";
-            case EXTENDED_REQUEST_START_TAG:
-                return "EXTENDED_REQUEST_START_TAG";
-            case EXTENDED_REQUEST_CONTROL_START_TAG:
-                return "EXTENDED_REQUEST_CONTROL_START_TAG";
-            case EXTENDED_REQUEST_CONTROL_END_TAG:
-                return "EXTENDED_REQUEST_CONTROL_END_TAG";
-            case EXTENDED_REQUEST_CONTROLVALUE_START_TAG:
-                return "EXTENDED_REQUEST_CONTROLVALUE_START_TAG";
-            case EXTENDED_REQUEST_CONTROLVALUE_END_TAG:
-                return "EXTENDED_REQUEST_CONTROLVALUE_END_TAG";
-            case EXTENDED_REQUEST_REQUESTNAME_START_TAG:
-                return "EXTENDED_REQUEST_REQUESTNAME_START_TAG";
-            case EXTENDED_REQUEST_REQUESTNAME_END_TAG:
-                return "EXTENDED_REQUEST_REQUESTNAME_END_TAG";
-            case EXTENDED_REQUEST_REQUESTVALUE_START_TAG:
-                return "EXTENDED_REQUEST_REQUESTVALUE_START_TAG";
-            case EXTENDED_REQUEST_REQUESTVALUE_END_TAG:
-                return "EXTENDED_REQUEST_REQUESTVALUE_END_TAG";
-            case MODIFY_DN_REQUEST_START_TAG:
-                return "MODIFY_DN_REQUEST_START_TAG";
-            case MODIFY_DN_REQUEST_CONTROL_START_TAG:
-                return "MODIFY_DN_REQUEST_CONTROL_START_TAG";
-            case MODIFY_DN_REQUEST_CONTROL_END_TAG:
-                return "MODIFY_DN_REQUEST_CONTROL_END_TAG";
-            case MODIFY_DN_REQUEST_CONTROLVALUE_START_TAG:
-                return "MODIFY_DN_REQUEST_CONTROLVALUE_START_TAG";
-            case MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG:
-                return "MODIFY_DN_REQUEST_CONTROLVALUE_END_TAG";
-            case MODIFY_REQUEST_START_TAG:
-                return "MODIFY_REQUEST_START_TAG";
-            case MODIFY_REQUEST_CONTROL_START_TAG:
-                return "MODIFY_REQUEST_CONTROL_START_TAG";
-            case MODIFY_REQUEST_CONTROL_END_TAG:
-                return "MODIFY_REQUEST_CONTROL_END_TAG";
-            case MODIFY_REQUEST_CONTROLVALUE_START_TAG:
-                return "MODIFY_REQUEST_CONTROLVALUE_START_TAG";
-            case MODIFY_REQUEST_CONTROLVALUE_END_TAG:
-                return "MODIFY_REQUEST_CONTROLVALUE_END_TAG";
-            case MODIFY_REQUEST_MODIFICATION_START_TAG:
-                return "MODIFY_REQUEST_MODIFICATION_START_TAG";
-            case MODIFY_REQUEST_MODIFICATION_END_TAG:
-                return "MODIFY_REQUEST_MODIFICATION_END_TAG";
-            case MODIFY_REQUEST_VALUE_START_TAG:
-                return "MODIFY_REQUEST_VALUE_START_TAG";
-            case MODIFY_REQUEST_VALUE_END_TAG:
-                return "MODIFY_REQUEST_VALUE_END_TAG";
-            case SEARCH_REQUEST_START_TAG:
-                return "SEARCH_REQUEST_START_TAG";
-            case SEARCH_REQUEST_CONTROL_START_TAG:
-                return "SEARCH_REQUEST_CONTROL_START_TAG";
-            case SEARCH_REQUEST_CONTROL_END_TAG:
-                return "SEARCH_REQUEST_CONTROL_END_TAG";
-            case SEARCH_REQUEST_CONTROLVALUE_START_TAG:
-                return "SEARCH_REQUEST_CONTROLVALUE_START_TAG";
-            case SEARCH_REQUEST_CONTROLVALUE_END_TAG:
-                return "SEARCH_REQUEST_CONTROLVALUE_END_TAG";
-            case SEARCH_REQUEST_FILTER_START_TAG:
-                return "SEARCH_REQUEST_FILTER_START_TAG";
-            case SEARCH_REQUEST_FILTER_END_TAG:
-                return "SEARCH_REQUEST_FILTER_END_TAG";
-            case SEARCH_REQUEST_ATTRIBUTES_START_TAG:
-                return "SEARCH_REQUEST_ATTRIBUTES_START_TAG";
-            case SEARCH_REQUEST_ATTRIBUTES_END_TAG:
-                return "SEARCH_REQUEST_ATTRIBUTES_END_TAG";
-            case SEARCH_REQUEST_ATTRIBUTE_START_TAG:
-                return "SEARCH_REQUEST_ATTRIBUTE_START_TAG";
-            case SEARCH_REQUEST_ATTRIBUTE_END_TAG:
-                return "SEARCH_REQUEST_ATTRIBUTE_END_TAG";
-            case SEARCH_REQUEST_EQUALITYMATCH_START_TAG:
-                return "SEARCH_REQUEST_EQUALITYMATCH_START_TAG";
-            case SEARCH_REQUEST_SUBSTRINGS_START_TAG:
-                return "SEARCH_REQUEST_SUBSTRINGS_START_TAG";
-            case SEARCH_REQUEST_SUBSTRINGS_END_TAG:
-                return "SEARCH_REQUEST_SUBSTRINGS_END_TAG";
-            case SEARCH_REQUEST_GREATEROREQUAL_START_TAG:
-                return "SEARCH_REQUEST_GREATEROREQUAL_START_TAG";
-            case SEARCH_REQUEST_LESSOREQUAL_START_TAG:
-                return "SEARCH_REQUEST_LESSOREQUAL_START_TAG";
-            case SEARCH_REQUEST_PRESENT_START_TAG:
-                return "SEARCH_REQUEST_PRESENT_START_TAG";
-            case SEARCH_REQUEST_APPROXMATCH_START_TAG:
-                return "SEARCH_REQUEST_APPROXMATCH_START_TAG";
-            case SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG:
-                return "SEARCH_REQUEST_EXTENSIBLEMATCH_START_TAG";
-            case SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_START_TAG:
-                return "SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_START_TAG";
-            case SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG:
-                return "SEARCH_REQUEST_EXTENSIBLEMATCH_VALUE_END_TAG";
-            case SEARCH_REQUEST_INITIAL_START_TAG:
-                return "SEARCH_REQUEST_INITIAL_START_TAG";
-            case SEARCH_REQUEST_INITIAL_END_TAG:
-                return "SEARCH_REQUEST_INITIAL_END_TAG";
-            case SEARCH_REQUEST_ANY_START_TAG:
-                return "SEARCH_REQUEST_ANY_START_TAG";
-            case SEARCH_REQUEST_ANY_END_TAG:
-                return "SEARCH_REQUEST_ANY_END_TAG";
-            case SEARCH_REQUEST_FINAL_START_TAG:
-                return "SEARCH_REQUEST_FINAL_START_TAG";
-            case SEARCH_REQUEST_FINAL_END_TAG:
-                return "SEARCH_REQUEST_FINAL_END_TAG";
-            case SEARCH_REQUEST_VALUE_START_TAG:
-                return "SEARCH_REQUEST_VALUE_START_TAG";
-            case SEARCH_REQUEST_VALUE_END_TAG:
-                return "SEARCH_REQUEST_VALUE_END_TAG";
-            case SEARCH_REQUEST_FILTER_LOOP:
-                return "SEARCH_REQUEST_FILTER_LOOP";
-
-            case BATCH_RESPONSE_LOOP:
-                return "BATCH_RESPONSE_LOOP";
-            case ERROR_RESPONSE:
-                return "ERROR_RESPONSE";
-            case MESSAGE_START:
-                return "MESSAGE_START";
-            case MESSAGE_END:
-                return "MESSAGE_END";
-            case DETAIL_START:
-                return "DETAIL_START";
-            case DETAIL_END:
-                return "DETAIL_END";
-            case EXTENDED_RESPONSE:
-                return "EXTENDED_RESPONSE";
-            case EXTENDED_RESPONSE_CONTROL_START:
-                return "EXTENDED_RESPONSE_CONTROL_START";
-            case EXTENDED_RESPONSE_CONTROL_END:
-                return "EXTENDED_RESPONSE_CONTROL_END";
-            case EXTENDED_RESPONSE_CONTROL_VALUE_START:
-                return "EXTENDED_RESPONSE_CONTROL_VALUE_START";
-            case EXTENDED_RESPONSE_CONTROL_VALUE_END:
-                return "EXTENDED_RESPONSE_CONTROL_VALUE_END";
-            case EXTENDED_RESPONSE_RESULT_CODE_START:
-                return "EXTENDED_RESPONSE_RESULT_CODE_START";
-            case EXTENDED_RESPONSE_RESULT_CODE_END:
-                return "EXTENDED_RESPONSE_RESULT_CODE_END";
-            case EXTENDED_RESPONSE_ERROR_MESSAGE_START:
-                return "EXTENDED_RESPONSE_ERROR_MESSAGE_START";
-            case EXTENDED_RESPONSE_ERROR_MESSAGE_END:
-                return "EXTENDED_RESPONSE_ERROR_MESSAGE_END";
-            case EXTENDED_RESPONSE_REFERRAL_START:
-                return "EXTENDED_RESPONSE_REFERRAL_START";
-            case EXTENDED_RESPONSE_REFERRAL_END:
-                return "EXTENDED_RESPONSE_REFERRAL_END";
-            case RESPONSE_NAME_START:
-                return "RESPONSE_NAME_START";
-            case RESPONSE_NAME_END:
-                return "RESPONSE_NAME_END";
-            case RESPONSE_START:
-                return "RESPONSE_START";
-            case RESPONSE_END:
-                return "RESPONSE_END";
-            case LDAP_RESULT:
-                return "LDAP_RESULT";
-            case LDAP_RESULT_CONTROL_START:
-                return "LDAP_RESULT_CONTROL_START";
-            case LDAP_RESULT_CONTROL_END:
-                return "LDAP_RESULT_CONTROL_END";
-            case LDAP_RESULT_CONTROL_VALUE_START:
-                return "LDAP_RESULT_CONTROL_VALUE_START";
-            case LDAP_RESULT_CONTROL_VALUE_END:
-                return "LDAP_RESULT_CONTROL_VALUE_END";
-            case LDAP_RESULT_RESULT_CODE_START:
-                return "LDAP_RESULT_RESULT_CODE_START";
-            case LDAP_RESULT_RESULT_CODE_END:
-                return "LDAP_RESULT_RESULT_CODE_END";
-            case LDAP_RESULT_ERROR_MESSAGE_START:
-                return "LDAP_RESULT_ERROR_MESSAGE_START";
-            case LDAP_RESULT_ERROR_MESSAGE_END:
-                return "LDAP_RESULT_ERROR_MESSAGE_END";
-            case LDAP_RESULT_REFERRAL_START:
-                return "LDAP_RESULT_REFERRAL_START";
-            case LDAP_RESULT_REFERRAL_END:
-                return "LDAP_RESULT_REFERRAL_END";
-            case LDAP_RESULT_END:
-                return "LDAP_RESULT_END";
-            case SEARCH_RESPONSE:
-                return "SEARCH_RESPONSE";
-            case SEARCH_RESULT_ENTRY:
-                return "SEARCH_RESULT_ENTRY";
-            case SEARCH_RESULT_ENTRY_CONTROL_START:
-                return "SEARCH_RESULT_ENTRY_CONTROL_START";
-            case SEARCH_RESULT_ENTRY_CONTROL_END:
-                return "SEARCH_RESULT_ENTRY_CONTROL_END";
-            case SEARCH_RESULT_ENTRY_CONTROL_VALUE_START:
-                return "SEARCH_RESULT_ENTRY_CONTROL_VALUE_START";
-            case SEARCH_RESULT_ENTRY_CONTROL_VALUE_END:
-                return "SEARCH_RESULT_ENTRY_CONTROL_VALUE_END";
-            case SEARCH_RESULT_ENTRY_ATTR_START:
-                return "SEARCH_RESULT_ENTRY_ATTR_START";
-            case SEARCH_RESULT_ENTRY_ATTR_END:
-                return "SEARCH_RESULT_ENTRY_ATTR_END";
-            case SEARCH_RESULT_ENTRY_VALUE_START:
-                return "SEARCH_RESULT_ENTRY_VALUE_START";
-            case SEARCH_RESULT_ENTRY_VALUE_END:
-                return "SEARCH_RESULT_ENTRY_VALUE_END";
-            case SEARCH_RESULT_ENTRY_LOOP:
-                return "SEARCH_RESULT_ENTRY_LOOP";
-            case SEARCH_RESULT_REFERENCE:
-                return "SEARCH_RESULT_REFERENCE";
-            case SEARCH_RESULT_REFERENCE_CONTROL_START:
-                return "SEARCH_RESULT_REFERENCE_CONTROL_START";
-            case SEARCH_RESULT_REFERENCE_CONTROL_END:
-                return "SEARCH_RESULT_REFERENCE_CONTROL_END";
-            case SEARCH_RESULT_REFERENCE_CONTROL_VALUE_START:
-                return "SEARCH_RESULT_REFERENCE_CONTROL_VALUE_START";
-            case SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END:
-                return "SEARCH_RESULT_REFERENCE_CONTROL_VALUE_END";
-            case SEARCH_RESULT_REFERENCE_REF_START:
-                return "SEARCH_RESULT_REFERENCE_REF_START";
-            case SEARCH_RESULT_REFERENCE_REF_END:
-                return "SEARCH_RESULT_REFERENCE_REF_END";
-            case SEARCH_RESULT_REFERENCE_LOOP:
-                return "SEARCH_RESULT_REFERENCE_LOOP";
-            case SEARCH_RESULT_DONE_END:
-                return "SEARCH_RESULT_DONE_END";
-
-            default:
-                return "UNKNOWN";
-        }
+        return state;
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/GrammarTransition.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/GrammarTransition.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/GrammarTransition.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/GrammarTransition.java Fri Oct 29 01:05:49 2010
@@ -30,13 +30,13 @@ package org.apache.directory.shared.dsml
 public class GrammarTransition
 {
     /** The next state in the grammar */
-    private int nextState;
+    private Enum<Dsmlv2StatesEnum> nextState;
 
     /** The action associated to the transition */
     private GrammarAction action;
 
     /** The current state */
-    private int currentState;
+    private Enum<Dsmlv2StatesEnum> currentState;
 
     
     /**
@@ -49,7 +49,7 @@ public class GrammarTransition
      * @param action
      *      The action to execute. It could be null.
      */
-    public GrammarTransition( int currentState, int nextState, GrammarAction action )
+    public GrammarTransition( Enum<Dsmlv2StatesEnum> currentState, Enum<Dsmlv2StatesEnum> nextState, GrammarAction action )
     {
         this.currentState = currentState;
         this.nextState = nextState;
@@ -62,7 +62,7 @@ public class GrammarTransition
      * @return
      *      the target state.
      */
-    public int getNextState()
+    public Enum<Dsmlv2StatesEnum> getNextState()
     {
         return nextState;
     }
@@ -103,13 +103,13 @@ public class GrammarTransition
      * @return 
      *      a representation of the transition as a string.
      */
-    public String toString( int grammar, IStates statesEnum )
+    public String toString( int grammar, Enum<Dsmlv2StatesEnum> statesEnum )
     {
 
         StringBuffer sb = new StringBuffer();
 
-        sb.append( "Transition from <" ).append( statesEnum.getState( currentState ) ).append( "> to <" ).append(
-            statesEnum.getState( nextState ) ).append( ">, action : " ).append(
+        sb.append( "Transition from <" ).append( currentState ).append( "> to <" ).append(
+            nextState ).append( ">, action : " ).append(
             ( ( action == null ) ? "no action" : action.toString() ) ).append( ">" );
 
         return sb.toString();

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IGrammar.java?rev=1028571&r1=1028570&r2=1028571&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IGrammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/IGrammar.java Fri Oct 29 01:05:49 2010
@@ -59,7 +59,7 @@ public interface IGrammar
      * 
      * @return The specific States Enum for the current grammar
      */
-    IStates getStatesEnum();
+    Enum<Dsmlv2StatesEnum>[] getStatesEnum();
 
 
     /**



Mime
View raw message