All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.artemis.model.scan.MethodScanner Maven / Gradle / Ivy

There is a newer version: 0.8.1
Show newest version
package com.artemis.model.scan;

import static org.objectweb.asm.Opcodes.ASM4;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Type;

public class MethodScanner extends MethodVisitor {

	private ArtemisTypeData config;
	private ConfigurationResolver resolver;

	public MethodScanner(ArtemisTypeData config, ConfigurationResolver resolver) {
		super(ASM4);
		this.config = config;
		this.resolver = resolver;
	}
	
	@Override
	public void visitLdcInsn(Object cst) {
		if (cst instanceof Type) {
			Type type = (Type)cst;
			if (resolver.components.contains(cst)) {
				config.optional.add(type);
			} else if (resolver.systems.contains(type)) {
				config.systems.add(type);
			} else if (resolver.managers.contains(type)) {
				config.managers.add(type);
			}
		}
		super.visitLdcInsn(cst);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy