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 * http://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 021 package org.apache.directory.shared.dsmlv2; 022 023 024 import java.io.IOException; 025 026 import org.xmlpull.v1.XmlPullParserException; 027 028 029 /** 030 * The interface which expose common behavior of a Gramar implementer. 031 */ 032 public interface IGrammar 033 { 034 // ~ Methods 035 // ------------------------------------------------------------------------------------ 036 037 /** 038 * This method, when called, execute an action on the current data stored in 039 * the container. 040 * 041 * @param container 042 * the DSML container 043 * @throws XmlPullParserException 044 * Thrown when an unrecoverable error occurs. 045 * @throws IOException 046 */ 047 void executeAction( Dsmlv2Container container ) throws XmlPullParserException, IOException; 048 049 050 /** 051 * Get the grammar name 052 * 053 * @return Return the grammar's name 054 */ 055 String getName(); 056 057 058 /** 059 * Get the statesEnum for the current grammar 060 * 061 * @return The specific States Enum for the current grammar 062 */ 063 IStates getStatesEnum(); 064 065 066 /** 067 * Set the grammar's name 068 * 069 * @param name 070 * The grammar name 071 */ 072 void setName( String name ); 073 }