KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > cglib > transform > FieldVisitorTee


1 /*
2  * Copyright 2003 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package net.sf.cglib.transform;
17
18 import org.objectweb.asm.AnnotationVisitor;
19 import org.objectweb.asm.Attribute;
20 import org.objectweb.asm.FieldVisitor;
21
22 public class FieldVisitorTee implements FieldVisitor {
23     private FieldVisitor fv1, fv2;
24     
25     public FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2) {
26         this.fv1 = fv1;
27         this.fv2 = fv2;
28     }
29
30     public AnnotationVisitor visitAnnotation(String JavaDoc desc, boolean visible) {
31         return AnnotationVisitorTee.getInstance(fv1.visitAnnotation(desc, visible),
32                                                 fv2.visitAnnotation(desc, visible));
33     }
34     
35     public void visitAttribute(Attribute attr) {
36         fv1.visitAttribute(attr);
37         fv2.visitAttribute(attr);
38     }
39
40     public void visitEnd() {
41         fv1.visitEnd();
42         fv2.visitEnd();
43     }
44 }
45
46
Popular Tags