KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > proguard > obfuscate > MappingProcessor


1 /*
2  * ProGuard -- shrinking, optimization, obfuscation, and preverification
3  * of Java bytecode.
4  *
5  * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21 package proguard.obfuscate;
22
23
24 /**
25  * This interface specifies methods to process name mappings between original
26  * classes and their obfuscated versions. The mappings are typically read
27  * from a mapping file.
28  *
29  * @see MappingReader
30  *
31  * @author Eric Lafortune
32  */

33 public interface MappingProcessor
34 {
35     /**
36      * Processes the given class name mapping.
37      *
38      * @param className the original class name.
39      * @param newClassName the new class name.
40      * @return whether the processor is interested in receiving mappings of the
41      * class members of this class.
42      */

43     public boolean processClassMapping(String JavaDoc className,
44                                        String JavaDoc newClassName);
45
46     /**
47      * Processes the given field name mapping.
48      *
49      * @param className the original class name.
50      * @param fieldType the original external field type.
51      * @param fieldName the original field name.
52      * @param newFieldName the new field name.
53      */

54     public void processFieldMapping(String JavaDoc className,
55                                     String JavaDoc fieldType,
56                                     String JavaDoc fieldName,
57                                     String JavaDoc newFieldName);
58
59     /**
60      * Processes the given method name mapping.
61      *
62      * @param className the original class name.
63      * @param firstLineNumber the first line number of the method, or
64      * 0 if it is not known.
65      * @param lastLineNumber the last line number of the method, or
66      * 0 if it is not known.
67      * @param methodReturnType the original external method return type.
68      * @param methodNameAndArguments the original external method name and
69      * arguments.
70      * @param newMethodName the new method name.
71      */

72     public void processMethodMapping(String JavaDoc className,
73                                      int firstLineNumber,
74                                      int lastLineNumber,
75                                      String JavaDoc methodReturnType,
76                                      String JavaDoc methodNameAndArguments,
77                                      String JavaDoc newMethodName);
78 }
79
Popular Tags