Example usage for javax.lang.model.element TypeElement getClass

List of usage examples for javax.lang.model.element TypeElement getClass

Introduction

In this page you can find the example usage for javax.lang.model.element TypeElement getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.mule.module.extension.internal.capability.xml.schema.AnnotationProcessorUtils.java

/**
 * Returns the {@link Class} object that is associated to the {@code typeElement}
 *
 * @param typeElement           a {@link TypeElement} which represents a {@link Class}
 * @param processingEnvironment the current {@link ProcessingEnvironment}
 * @param <T>                   the generic type of the returned {@link Class}
 * @return the {@link Class} represented by {@code typeElement}
 *//*from  w  w  w.  j  a  va  2 s.  c  om*/
public static <T> Class<T> classFor(TypeElement typeElement, ProcessingEnvironment processingEnvironment) {
    try {
        return ClassUtils.loadClass(
                processingEnvironment.getElementUtils().getBinaryName(typeElement).toString(),
                typeElement.getClass());
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}