01: /* Soot - a J*va Optimization Framework
02: * Copyright (C) 2005 Jennifer Lhotak
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * 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
16: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17: * Boston, MA 02111-1307, USA.
18: */
19:
20: /*
21: * Modified by the Sable Research Group and others 1997-1999.
22: * See the 'credits' file distributed with Soot for the complete list of
23: * contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
24: */
25:
26: package soot.tagkit;
27:
28: /** Represents the enclosing method attribute attatched to anon and
29: * inner classes to indicate the class and method it is declared in
30: * for Java 1.5.
31: */
32:
33: public class EnclosingMethodTag implements Tag {
34:
35: private String enclosingClass;
36: private String enclosingMethod;
37: private String enclosingMethodSig;
38:
39: public EnclosingMethodTag(String c, String m, String s) {
40: this .enclosingClass = c;
41: this .enclosingMethod = m;
42: this .enclosingMethodSig = s;
43: }
44:
45: public String toString() {
46: return "Enclosing Class: " + enclosingClass
47: + " Enclosing Method: " + enclosingMethod + " Sig: "
48: + enclosingMethodSig;
49: }
50:
51: /** Returns the tag name. */
52: public String getName() {
53: return "EnclosingMethodTag";
54: }
55:
56: public String getInfo() {
57: return "EnclosingMethod";
58: }
59:
60: public String getEnclosingClass() {
61: return enclosingClass;
62: }
63:
64: public String getEnclosingMethod() {
65: return enclosingMethod;
66: }
67:
68: public String getEnclosingMethodSig() {
69: return enclosingMethodSig;
70: }
71:
72: /** Returns the tag raw data. */
73: public byte[] getValue() {
74: throw new RuntimeException(
75: "EnclosingMethodTag has no value for bytecode");
76: }
77: }
|