ForgePatch/src/main/java/net/minecraftforge/fml/common/discovery/asm/ModMethodVisitor.java

48 lines
1.5 KiB
Java
Raw Normal View History

/*
* Minecraft Forge
* Copyright (c) 2016-2018.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
2014-09-23 05:01:24 +00:00
package net.minecraftforge.fml.common.discovery.asm;
2012-07-22 14:26:38 +00:00
import org.objectweb.asm.AnnotationVisitor;
2012-07-22 14:26:38 +00:00
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
public class ModMethodVisitor extends MethodVisitor {
2012-07-22 14:26:38 +00:00
private String methodName;
private String methodDescriptor;
2012-07-22 14:26:38 +00:00
private ASMModParser discoverer;
public ModMethodVisitor(String name, String desc, ASMModParser discoverer)
2012-07-22 14:26:38 +00:00
{
super(Opcodes.ASM5);
this.methodName = name;
this.methodDescriptor = desc;
2012-07-22 14:26:38 +00:00
this.discoverer = discoverer;
}
2012-07-22 14:26:38 +00:00
@Override
public AnnotationVisitor visitAnnotation(String annotationName, boolean runtimeVisible)
2012-07-22 14:26:38 +00:00
{
discoverer.startMethodAnnotation(methodName, methodDescriptor, annotationName);
return new ModAnnotationVisitor(discoverer);
2012-07-22 14:26:38 +00:00
}
2012-07-22 14:26:38 +00:00
}