Example usage for org.objectweb.asm Type type

List of usage examples for org.objectweb.asm Type type

Introduction

In this page you can find the example usage for org.objectweb.asm Type type.

Prototype

type

Source Link

Usage

From source file:com.github.anba.es6draft.compiler.assembler.InstructionAssembler.java

License:Open Source License

public void tconst(Type type) {
    methodVisitor.visitLdcInsn(type.type());
    stack.tconst(type);
}

From source file:org.codehaus.backport175.reader.proxy.JavaDocAnnotationInvocationHander.java

License:Open Source License

/**
 * Returns the resolved value for the annotation element.
 *
 * @param namedValue/*from  w w  w. j  ava 2 s  .co m*/
 * @param valueType
 * @return
 */
private Object resolveValue(final AnnotationElement.NamedValue namedValue, final Class valueType) {
    if (namedValue.isResolved()) {
        return namedValue.getResolvedValue();
    }
    AnnotationElement.Type type = namedValue.getType();
    final Object value;
    if (type.equals(AnnotationElement.Type.ANNOTATION)) {
        AnnotationElement.Annotation annotation = (AnnotationElement.Annotation) namedValue.getValue();
        value = ProxyFactory.newAnnotationProxy(annotation, getAnnotatedClassClassLoader());

    } else if (type.equals(AnnotationElement.Type.ARRAY)) {
        value = resolveArray(namedValue, valueType);

    } else if (type.equals(AnnotationElement.Type.ENUM)) {
        value = resolveEnum(namedValue);

    } else if (type.equals(AnnotationElement.Type.TYPE)) {
        value = resolveType(namedValue);

    } else {
        value = namedValue.getValue();
    }
    namedValue.setResolvedValue(value);
    return value;
}