public R visit(String name, int pos, Annotation value, P param) {
        Class<? extends Annotation> annotationType = value.annotationType();

        Method[] methods = annotationType.getMethods();

        if (mMethodComparator != null) {
            Arrays.sort(methods, mMethodComparator);
        }

        int i = 0;
        for (Method m : methods) {
            if (m.getDeclaringClass() != annotationType || m.getParameterTypes().length > 0) {
                continue;
            }

            Class propType = m.getReturnType();
            if (propType == void.class) {
                continue;
            }

            String propName = m.getName();
            Object propValue;
            try {
                propValue = m.invoke(value);
            } catch (Exception e) {
                ThrowUnchecked.fireRootCause(e);
                return null;
            }

            if (propType.isArray()) {
                if (propType.isPrimitive()) {
                    propType = propType.getComponentType();
                    if (propType == int.class) {
                        visit(propName, i, (int[]) propValue, param);
                    } else if (propType == long.class) {
                        visit(propName, i, (long[]) propValue, param);
                    } else if (propType == float.class) {
                        visit(propName, i, (float[]) propValue, param);
                    } else if (propType == double.class) {
                        visit(propName, i, (double[]) propValue, param);
                    } else if (propType == boolean.class) {
                        visit(propName, i, (boolean[]) propValue, param);
                    } else if (propType == byte.class) {
                        visit(propName, i, (byte[]) propValue, param);
                    } else if (propType == short.class) {
                        visit(propName, i, (short[]) propValue, param);
                    } else if (propType == char.class) {
                        visit(propName, i, (char[]) propValue, param);
                    }
                } else if (propValue instanceof String[]) {
                    visit(propName, i, (String[]) propValue, param);
                } else if (propValue instanceof Class[]) {
                    visit(propName, i, (Class[]) propValue, param);
                } else if (propValue instanceof Enum[]) {
                    visit(propName, i, (Enum[]) propValue, param);
                } else if (propValue instanceof Annotation[]) {
                    visit(propName, i, (Annotation[]) propValue, param);
                }
            } else if (propType.isPrimitive()) {
                if (propType == int.class) {
                    visit(propName, i, (Integer) propValue, param);
                } else if (propType == long.class) {
                    visit(propName, i, (Long) propValue, param);
                } else if (propType == float.class) {
                    visit(propName, i, (Float) propValue, param);
                } else if (propType == double.class) {
                    visit(propName, i, (Double) propValue, param);
                } else if (propType == boolean.class) {
                    visit(propName, i, (Boolean) propValue, param);
                } else if (propType == byte.class) {
                    visit(propName, i, (Byte) propValue, param);
                } else if (propType == short.class) {
                    visit(propName, i, (Short) propValue, param);
                } else if (propType == char.class) {
                    visit(propName, i, (Character) propValue, param);
                }
            } else if (propValue instanceof String) {
                visit(propName, i, (String) propValue, param);
            } else if (propValue instanceof Class) {
                visit(propName, i, (Class) propValue, param);
            } else if (propValue instanceof Enum) {
                visit(propName, i, (Enum) propValue, param);
            } else if (propValue instanceof Annotation) {
                visit(propName, i, (Annotation) propValue, param);
            }

            i++;
        }

        return null;
    }
public R visit ( String name , int pos , Annotation value , P param ) { Class < ? extends Annotation > annotationType = value . annotationType ( ) ; Method [ ] methods = annotationType . getMethods ( ) ; if ( mMethodComparator != null ) { Arrays . sort ( methods , mMethodComparator ) ; } int i = 0 ; for ( Method m : methods ) { if ( m . getDeclaringClass ( ) != annotationType || m . getParameterTypes ( ) . length > 0 ) { continue ; } Class propType = m . getReturnType ( ) ; if ( propType == void . class ) { continue ; } String propName = m . getName ( ) ; Object propValue ; try { propValue = m . invoke ( value ) ; } catch ( Exception e ) { ThrowUnchecked . fireRootCause ( e ) ; return null ; } if ( propType . isArray ( ) ) { if ( propType . isPrimitive ( ) ) { propType = propType . getComponentType ( ) ; if ( propType == int . class ) { visit ( propName , i , ( int [ ] ) propValue , param ) ; } else if ( propType == long . class ) { visit ( propName , i , ( long [ ] ) propValue , param ) ; } else if ( propType == float . class ) { visit ( propName , i , ( float [ ] ) propValue , param ) ; } else if ( propType == double . class ) { visit ( propName , i , ( double [ ] ) propValue , param ) ; } else if ( propType == boolean . class ) { visit ( propName , i , ( boolean [ ] ) propValue , param ) ; } else if ( propType == byte . class ) { visit ( propName , i , ( byte [ ] ) propValue , param ) ; } else if ( propType == short . class ) { visit ( propName , i , ( short [ ] ) propValue , param ) ; } else if ( propType == char . class ) { visit ( propName , i , ( char [ ] ) propValue , param ) ; } } else if ( propValue instanceof String [ ] ) { visit ( propName , i , ( String [ ] ) propValue , param ) ; } else if ( propValue instanceof Class [ ] ) { visit ( propName , i , ( Class [ ] ) propValue , param ) ; } else if ( propValue instanceof Enum [ ] ) { visit ( propName , i , ( Enum [ ] ) propValue , param ) ; } else if ( propValue instanceof Annotation [ ] ) { visit ( propName , i , ( Annotation [ ] ) propValue , param ) ; } } else if ( propType . isPrimitive ( ) ) { if ( propType == int . class ) { visit ( propName , i , ( Integer ) propValue , param ) ; } else if ( propType == long . class ) { visit ( propName , i , ( Long ) propValue , param ) ; } else if ( propType == float . class ) { visit ( propName , i , ( Float ) propValue , param ) ; } else if ( propType == double . class ) { visit ( propName , i , ( Double ) propValue , param ) ; } else if ( propType == boolean . class ) { visit ( propName , i , ( Boolean ) propValue , param ) ; } else if ( propType == byte . class ) { visit ( propName , i , ( Byte ) propValue , param ) ; } else if ( propType == short . class ) { visit ( propName , i , ( Short ) propValue , param ) ; } else if ( propType == char . class ) { visit ( propName , i , ( Character ) propValue , param ) ; } } else if ( propValue instanceof String ) { visit ( propName , i , ( String ) propValue , param ) ; } else if ( propValue instanceof Class ) { visit ( propName , i , ( Class ) propValue , param ) ; } else if ( propValue instanceof Enum ) { visit ( propName , i , ( Enum ) propValue , param ) ; } else if ( propValue instanceof Annotation ) { visit ( propName , i , ( Annotation ) propValue , param ) ; } i ++ ; } return null ; }
Visits an annotation by breaking it down into its components and calling
various other visit methods.

@param name member name, or null if array member or not part of an annotation
@param pos position of member in list or array
@param value Annotation visited
@param param custom parameter
@return custom result, null by default