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 org.mockito.cglib.transform; 17 18 import org.mockito.asm.AnnotationVisitor; 19 import org.mockito.asm.Attribute; 20 import org.mockito.asm.FieldVisitor; 21 22 public class FieldVisitorTee implements FieldVisitor { 23 private FieldVisitor fv1, fv2; 24 FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2)25 public FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2) { 26 this.fv1 = fv1; 27 this.fv2 = fv2; 28 } 29 visitAnnotation(String desc, boolean visible)30 public AnnotationVisitor visitAnnotation(String desc, boolean visible) { 31 return AnnotationVisitorTee.getInstance(fv1.visitAnnotation(desc, visible), 32 fv2.visitAnnotation(desc, visible)); 33 } 34 visitAttribute(Attribute attr)35 public void visitAttribute(Attribute attr) { 36 fv1.visitAttribute(attr); 37 fv2.visitAttribute(attr); 38 } 39 visitEnd()40 public void visitEnd() { 41 fv1.visitEnd(); 42 fv2.visitEnd(); 43 } 44 } 45 46