01: /*
02: * ProGuard -- shrinking, optimization, obfuscation, and preverification
03: * of Java bytecode.
04: *
05: * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the Free
09: * 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: * This interface specifies methods to process name mappings between original
25: * classes and their obfuscated versions. The mappings are typically read
26: * from a mapping file.
27: *
28: * @see MappingReader
29: *
30: * @author Eric Lafortune
31: */
32: public interface MappingProcessor {
33: /**
34: * Processes the given class name mapping.
35: *
36: * @param className the original class name.
37: * @param newClassName the new class name.
38: * @return whether the processor is interested in receiving mappings of the
39: * class members of this class.
40: */
41: public boolean processClassMapping(String className,
42: String newClassName);
43:
44: /**
45: * Processes the given field name mapping.
46: *
47: * @param className the original class name.
48: * @param fieldType the original external field type.
49: * @param fieldName the original field name.
50: * @param newFieldName the new field name.
51: */
52: public void processFieldMapping(String className, String fieldType,
53: String fieldName, String newFieldName);
54:
55: /**
56: * Processes the given method name mapping.
57: *
58: * @param className the original class name.
59: * @param firstLineNumber the first line number of the method, or
60: * 0 if it is not known.
61: * @param lastLineNumber the last line number of the method, or
62: * 0 if it is not known.
63: * @param methodReturnType the original external method return type.
64: * @param methodNameAndArguments the original external method name and
65: * arguments.
66: * @param newMethodName the new method name.
67: */
68: public void processMethodMapping(String className,
69: int firstLineNumber, int lastLineNumber,
70: String methodReturnType, String methodNameAndArguments,
71: String newMethodName);
72: }
|