< prev index next >

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

Print this page




  50  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  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.FieldVisitor;
  64 import jdk.internal.org.objectweb.asm.Opcodes;
  65 import jdk.internal.org.objectweb.asm.TypePath;
  66 
  67 /**
  68  * A {@link FieldVisitor} adapter for type remapping.
  69  *

  70  * @author Eugene Kuleshov
  71  */

  72 public class RemappingFieldAdapter extends FieldVisitor {
  73 
  74     private final Remapper remapper;
  75 
  76     public RemappingFieldAdapter(final FieldVisitor fv, final Remapper remapper) {
  77         this(Opcodes.ASM5, fv, remapper);
  78     }
  79 
  80     protected RemappingFieldAdapter(final int api, final FieldVisitor fv,
  81             final Remapper remapper) {
  82         super(api, fv);
  83         this.remapper = remapper;
  84     }
  85 
  86     @Override
  87     public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
  88         AnnotationVisitor av = fv.visitAnnotation(remapper.mapDesc(desc),
  89                 visible);
  90         return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
  91     }


  50  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  51  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  52  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  53  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  54  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  55  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  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.FieldVisitor;
  64 import jdk.internal.org.objectweb.asm.Opcodes;
  65 import jdk.internal.org.objectweb.asm.TypePath;
  66 
  67 /**
  68  * A {@link FieldVisitor} adapter for type remapping.
  69  *
  70  * @deprecated use {@link FieldRemapper} instead.
  71  * @author Eugene Kuleshov
  72  */
  73 @Deprecated
  74 public class RemappingFieldAdapter extends FieldVisitor {
  75 
  76     private final Remapper remapper;
  77 
  78     public RemappingFieldAdapter(final FieldVisitor fv, final Remapper remapper) {
  79         this(Opcodes.ASM5, fv, remapper);
  80     }
  81 
  82     protected RemappingFieldAdapter(final int api, final FieldVisitor fv,
  83             final Remapper remapper) {
  84         super(api, fv);
  85         this.remapper = remapper;
  86     }
  87 
  88     @Override
  89     public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
  90         AnnotationVisitor av = fv.visitAnnotation(remapper.mapDesc(desc),
  91                 visible);
  92         return av == null ? null : new RemappingAnnotationAdapter(av, remapper);
  93     }
< prev index next >