public int getArrayLength ( ) throws ReflectorException { if ( object == null ) { logger . error ( "object is null: did you specify it using the 'inspect()' method?" ) ; throw new ReflectorException ( "object is null: did you specify it using the 'inspect()' method?" ) ; } int length = 0 ; if ( object . getClass ( ) . isArray ( ) ) { length = Array . getLength ( object ) ; } else if ( object instanceof List < ? > ) { length = ( ( List < ? > ) object ) . size ( ) ; } else { throw new ReflectorException ( "object is not an array or a list" ) ; } return length ; }
Returns the number of elements in the array or list object ;