Java Code Examples for java.lang.reflect.AnnotatedArrayType

Following code examples demonstrate how to use java.lang.reflect.AnnotatedArrayTypefrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use java.lang.reflect.AnnotatedArrayTypeand various code implementation of this class.

    public static void main(String[] args) throws NoSuchFieldException {
        Field field5 = Child.class.getField("field5");
    
        AnnotatedType annotatedType = field5.getAnnotatedType();
        System.out.print("annotatedType真实类型:");
        System.out.println(annotatedType.getClass().getSimpleName());
    
        AnnotatedArrayType aat = (AnnotatedArrayType)annotatedType;
        
        System.out.print("aat真实类型:");
        System.out.println(aat.getClass().getSimpleName());
    
        System.out.print("aat中的被注解通用组件类型:");
        System.out.println(aat.getAnnotatedGenericComponentType().getClass().getSimpleName());
    
        System.out.print("aat中的被注解通用组件类型的注解:");
        System.out.println(aat.getAnnotatedGenericComponentType().getAnnotations()[0]);
        
        System.out.print("aat中的被注解通用组件类型的类型:");
        System.out.println(aat.getAnnotatedGenericComponentType().getType());
    } 


    public void getAttributes(Yield yield, AnnotatedArrayType value) {
        if (cliOptions.annotation) {
            yield.apply(value.getAnnotatedGenericComponentType(), "getAnnotatedGenericComponentType");
        }
    } 

    public boolean matches(ConditionContext conditionContext, AnnotatedArrayType annotatedArrayType) {
        Environment currentEnvironment = conditionContext.getEnvironment();
        String online = currentEnvironment.getProperty("api.environment");
        return StringUtils.isNotBlank(online) && online.toUpperCase().equals("PROD");
    } 

    @Test
    public default void verifyGenericType()
    throws Exception {
        final Class<SUT> sut = createNewSUT();
        assertTrue("This j8unit test interface is used with a generic type that is illegaly not assignable to AnnotatedArrayType.class!",
                   AnnotatedArrayType.class.isAssignableFrom(sut));
    } 

    public static AnnotatedArrayTypeDescription create(AnnotatedArrayType nativeType) {
        AnnotatedArrayTypeDescription description = new AnnotatedArrayTypeDescription();
        description.nativeType = nativeType;
        return description;
    } 

   CoreReflectionArrayType(AnnotatedArrayType base) {
      super(base);
      this.component =
            CoreReflectionTypes.INSTANCE.getTypeMirror(base.getAnnotatedGenericComponentType());
   }