KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > percederberg > grammatica > ant > ProcessingElement


1 /*
2  * ProcessingElement.java
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 2.1
7  * of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17  * MA 02111-1307, USA.
18  *
19  * Copyright (c) 2003-2005 Per Cederberg. All rights reserved.
20  */

21
22 package net.percederberg.grammatica.ant;
23
24 import org.apache.tools.ant.BuildException;
25
26 import net.percederberg.grammatica.Grammar;
27
28 /**
29  * An grammar processing element. A processing element transforms the
30  * grammar to some other form, normally source code. One or more
31  * processing elements may be present in the Grammatica Ant task.
32  *
33  * @author Per Cederberg, <per at percederberg dot net>
34  * @version 1.4
35  * @since 1.4
36  */

37 public interface ProcessingElement {
38
39     /**
40      * Validates all attributes in the element.
41      *
42      * @throws BuildException if some attribute was missing or had an
43      * invalid value
44      */

45     void validate() throws BuildException;
46
47     /**
48      * Proceses the specified grammar.
49      *
50      * @param grammar the grammar to process
51      *
52      * @throws BuildException if the grammar couldn't be processed
53      * correctly
54      */

55     void process(Grammar grammar) throws BuildException;
56 }
57
Popular Tags