01: /**
02: * Copyright (C) 2001-2005 France Telecom R&D
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 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 Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.speedo.generation.enhancer.common;
18:
19: import org.objectweb.asm.Attribute;
20: import org.objectweb.asm.ClassVisitor;
21: import org.objectweb.asm.CodeVisitor;
22: import org.objectweb.util.monolog.api.Logger;
23: import org.objectweb.util.monolog.api.BasicLevel;
24:
25: /**
26: *
27: * @author S.Chassande-Barrioz
28: */
29: public class LoggedClassVisitor implements ClassVisitor {
30:
31: protected Logger logger;
32: protected boolean debug = false;
33:
34: public LoggedClassVisitor() {
35: }
36:
37: public LoggedClassVisitor(Logger logger) {
38: this .logger = logger;
39: if (logger != null) {
40: debug = logger.isLoggable(BasicLevel.DEBUG);
41: }
42: }
43:
44: public Logger getLogger() {
45: return logger;
46: }
47:
48: public void setLogger(Logger logger) {
49: this .logger = logger;
50: }
51:
52: public void visit(int version, int i, String s, String s1,
53: String[] strings, String s2) {
54: }
55:
56: public void visitInnerClass(String s, String s1, String s2, int i) {
57: }
58:
59: public void visitField(final int access, final String name,
60: final String desc, final Object value, final Attribute attrs) {
61: }
62:
63: public CodeVisitor visitMethod(int i, String s, String s1,
64: String[] strings, Attribute attrs) {
65: return null;
66: }
67:
68: public void visitAttribute(Attribute attribute) {
69: }
70:
71: public void visitEnd() {
72: }
73:
74: }
|