KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > preprocessorbridge > spi > JavaFileFilterImplementation


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.preprocessorbridge.spi;
21
22 import java.io.Reader JavaDoc;
23 import java.io.Writer JavaDoc;
24 import javax.swing.event.ChangeListener JavaDoc;
25
26 /**
27  * This interface in a friend contract among the j2me project and java/source
28  * module. The implementation preprocesses the java file content when it's red by the
29  * java infrastructure if needed. From the performance reasons there can be just one
30  * implementation of this interface for all sources in the project.
31  *
32  * @author Tomas Zezula
33  */

34 public interface JavaFileFilterImplementation {
35         
36     /**
37      * Filters an {@link Reader} by the preprocessor.
38      * @param r {@link Reader} to be preprocessed
39      * @return an preprocessed {@link Reader}
40      */

41     public Reader JavaDoc filterReader (Reader JavaDoc r);
42     
43     /**
44      * Filters an input {@link CharSequence} by the preprocessor. From the performance reason
45      * it's highly recomended to implement the method using decorator pattern.
46      * @param charSequence {@link CharSequence} to be preprocessed
47      * @return an preprocessed {@link CharSequence}
48      */

49     public CharSequence JavaDoc filterCharSequence (CharSequence JavaDoc charSequence);
50         
51     /**
52      * Filters an {@link Writer} by the preprocessor.
53      * @param w {@link Writer} to be preprocessed
54      * @return an preprocessed {@link Writer}
55      */

56     public Writer JavaDoc filterWriter (Writer JavaDoc w);
57     
58     /**
59      * Adds an {@link ChangeListener} to the {@link JavaFileFilterImplementation}
60      * The implementor should fire a change when the rules for preprocessing has changed
61      * and files should be rescanned.
62      * @param listener to be added
63      */

64     public void addChangeListener (ChangeListener JavaDoc listener);
65     
66
67     /**
68      * Removes an {@link ChangeListener} to the {@link JavaFileFilterImplementation}
69      * The implementor should fire a change when the rules for preprocessing has changed
70      * and files should be rescanned.
71      * @param listener to be removed
72      */

73     public void removeChangeListener (ChangeListener JavaDoc listener);
74 }
75
Popular Tags