    001/*
    002 * Forge Mod Loader
    003 * Copyright (c) 2012-2013 cpw.
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the GNU Lesser Public License v2.1
    006 * which accompanies this distribution, and is available at
    007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    008 *
    009 * Contributors:
    010 *     cpw - implementation
    011 */
    012
    013package cpw.mods.fml.common.discovery.asm;
    014
    015import org.objectweb.asm.AnnotationVisitor;
    016import org.objectweb.asm.FieldVisitor;
    017import org.objectweb.asm.Opcodes;
    018
    019public class ModFieldVisitor extends FieldVisitor
    020{
    021
    022    private String fieldName;
    023    private ASMModParser discoverer;
    024
    025    public ModFieldVisitor(String name, ASMModParser discoverer)
    026    {
    027        super(Opcodes.ASM4);
    028        this.fieldName = name;
    029        this.discoverer = discoverer;
    030    }
    031
    032    @Override
    033    public AnnotationVisitor visitAnnotation(String annotationName, boolean runtimeVisible)
    034    {
    035        discoverer.startFieldAnnotation(fieldName, annotationName);
    036        return new ModAnnotationVisitor(discoverer);
    037    }
    038}