@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public void setElementAtIndex ( int index , Object value ) 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?" ) ; } if ( object . getClass ( ) . isArray ( ) ) { Array . set ( object , translateArrayIndex ( index , getArrayLength ( ) ) , value ) ; } else if ( object instanceof List < ? > ) { ( ( List ) object ) . set ( index , value ) ; } else { throw new ReflectorException ( "object is not an array or a list" ) ; } }
Sets the value of the n - th element in an array or a list .