< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/commons/AnnotationRemapper.java

Print this page
rev 47452 : imported patch jdk-new-asmv6.patch


  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 
  60 package jdk.internal.org.objectweb.asm.commons;
  61 
  62 import jdk.internal.org.objectweb.asm.AnnotationVisitor;
  63 import jdk.internal.org.objectweb.asm.Opcodes;
  64 
  65 /**
  66  * An {@link AnnotationVisitor} adapter for type remapping.
  67  *
  68  * @author Eugene Kuleshov
  69  */
  70 public class AnnotationRemapper extends AnnotationVisitor {
  71 
  72     protected final Remapper remapper;
  73 
  74     public AnnotationRemapper(final AnnotationVisitor av,
  75             final Remapper remapper) {
  76         this(Opcodes.ASM5, av, remapper);
  77     }
  78 
  79     protected AnnotationRemapper(final int api, final AnnotationVisitor av,
  80             final Remapper remapper) {
  81         super(api, av);
  82         this.remapper = remapper;
  83     }
  84 
  85     @Override
  86     public void visit(String name, Object value) {
  87         av.visit(name, remapper.mapValue(value));
  88     }
  89 
  90     @Override
  91     public void visitEnum(String name, String desc, String value) {
  92         av.visitEnum(name, remapper.mapDesc(desc), value);
  93     }
  94 
  95     @Override
  96     public AnnotationVisitor visitAnnotation(String name, String desc) {


  56  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  57  * THE POSSIBILITY OF SUCH DAMAGE.
  58  */
  59 
  60 package jdk.internal.org.objectweb.asm.commons;
  61 
  62 import jdk.internal.org.objectweb.asm.AnnotationVisitor;
  63 import jdk.internal.org.objectweb.asm.Opcodes;
  64 
  65 /**
  66  * An {@link AnnotationVisitor} adapter for type remapping.
  67  *
  68  * @author Eugene Kuleshov
  69  */
  70 public class AnnotationRemapper extends AnnotationVisitor {
  71 
  72     protected final Remapper remapper;
  73 
  74     public AnnotationRemapper(final AnnotationVisitor av,
  75             final Remapper remapper) {
  76         this(Opcodes.ASM6, av, remapper);
  77     }
  78 
  79     protected AnnotationRemapper(final int api, final AnnotationVisitor av,
  80             final Remapper remapper) {
  81         super(api, av);
  82         this.remapper = remapper;
  83     }
  84 
  85     @Override
  86     public void visit(String name, Object value) {
  87         av.visit(name, remapper.mapValue(value));
  88     }
  89 
  90     @Override
  91     public void visitEnum(String name, String desc, String value) {
  92         av.visitEnum(name, remapper.mapDesc(desc), value);
  93     }
  94 
  95     @Override
  96     public AnnotationVisitor visitAnnotation(String name, String desc) {
< prev index next >