get Base Type of enterprise annotation - Java java.lang.annotation

Java examples for java.lang.annotation:Enterprise Annotation

Description

get Base Type of enterprise annotation

Demo Code


import java.lang.reflect.Method;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.AnnotatedType;

public class Main{
    public static BaseType getBaseType(Annotated annotated) {
        if (annotated instanceof BaseTypeAnnotated)
            return ((BaseTypeAnnotated) annotated).getBaseTypeImpl();
        else/*from www .  j a v  a  2s .  c  om*/
            return BaseTypeFactory.getCurrent().createForTarget(
                    annotated.getBaseType());
    }
}

Related Tutorials