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

com.artemis.meta.ProfileAnnotationReader Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package com.artemis.meta;


import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;

final class ProfileAnnotationReader extends AnnotationVisitor {
	private final String annotationField;
	private ClassMetadata info;

	ProfileAnnotationReader(String name, ClassMetadata info) {
		super(Opcodes.ASM4);
		this.annotationField = name;
		this.info = info;
	}

	@Override
	public void visit(String field, Object value) {
		if ("using".equals(field))
			info.profilerClass = (Type)value;
		else if ("enabled".equals(field))
			info.profilingEnabled = (Boolean)value;
		
		super.visit(annotationField, value);
	}
	
	@Override
	public AnnotationVisitor visitArray(final String name) {
		return new ProfileAnnotationReader(name, info);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy