1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 21 package org.apache.directory.api.ldap.extras.extended.ads_impl.storedProcedure; 22 23 24 import org.apache.directory.api.asn1.ber.grammar.States; 25 26 27 /** 28 * Constants for StoredProcedureGrammar. 29 * 30 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 31 */ 32 public enum StoredProcedureStatesEnum implements States 33 { 34 //~ Static fields/initializers ----------------------------------------------------------------- 35 36 /** The END_STATE */ 37 END_STATE, 38 39 //========================================================================= 40 // StoredProcedure 41 //========================================================================= 42 /** starting state */ 43 START_STATE, 44 45 /** StoredProcedure */ 46 STORED_PROCEDURE_STATE, 47 48 // Language --------------------------------------------------------------- 49 /** Language */ 50 LANGUAGE_STATE, 51 52 // Procedure -------------------------------------------------------------- 53 /** Procedure */ 54 PROCEDURE_STATE, 55 56 // Parameters ------------------------------------------------------------- 57 /** Parameters */ 58 PARAMETERS_STATE, 59 60 // Parameter -------------------------------------------------------------- 61 /** Parameter */ 62 PARAMETER_STATE, 63 64 // Parameter type --------------------------------------------------------- 65 /** Parameter type */ 66 PARAMETER_TYPE_STATE, 67 68 // Parameters value ------------------------------------------------------- 69 /** Parameter value */ 70 PARAMETER_VALUE_STATE, 71 72 /** Last Stored Procedure */ 73 LAST_STORED_PROCEDURE_STATE; 74 75 /** 76 * Get the grammar name 77 * 78 * @return The grammar name 79 */ 80 public String getGrammarName() 81 { 82 return "STORED_PROCEDURE_GRAMMAR"; 83 } 84 85 86 /** 87 * Get the string representing the state 88 * 89 * @param state The state number 90 * @return The String representing the state 91 */ 92 public String getState( int state ) 93 { 94 return ( state == END_STATE.ordinal() ) ? "STORED_PROCEDURE_END_STATE" : name(); 95 } 96 97 98 /** 99 * {@inheritDoc} 100 */ 101 @Override 102 public boolean isEndState() 103 { 104 return this == END_STATE; 105 } 106 107 108 /** 109 * {@inheritDoc} 110 */ 111 @Override 112 public StoredProcedureStatesEnum getStartState() 113 { 114 return START_STATE; 115 } 116 }