public Type getIterationElementType ( ) throws IntrospectionException { if ( ! mCheckedForIteration ) { mCheckedForIteration = true ; if ( mIterationElementType != null ) return mIterationElementType ; if ( mNaturalClass . isArray ( ) ) { mIterationElementType = getArrayElementType ( ) ; } else if ( Collection . class . isAssignableFrom ( mNaturalClass ) || Map . class . isAssignableFrom ( mNaturalClass ) ) { mIterationElementType = getIterationType ( mGenericType ) ; if ( mIterationElementType == null || mIterationElementType == OBJECT_TYPE ) { try { Field field = mNaturalClass . getField ( BeanAnalyzer . ELEMENT_TYPE_FIELD_NAME ) ; if ( field . getType ( ) == Class . class && Modifier . isStatic ( field . getModifiers ( ) ) ) { mIterationElementType = new Type ( ( Class < ? > ) field . get ( null ) ) ; } } catch ( NoSuchFieldException e ) { // nothing to do } catch ( IllegalAccessException e ) { // nothing to do } } } if ( mIterationElementType == null ) { mIterationElementType = Type . OBJECT_TYPE ; } } return mIterationElementType ; }
If this type supports iteration then the element type is returned . Otherwise null is returned .