@ SuppressWarnings ( { "rawtypes" } ) private static void deleteObjectInContext ( final Collection lastCollection , final EachCommand eachCommand , final int lastCollectionIndex , final Map < String , Object > dataContext ) { if ( ! ( lastCollection instanceof List ) ) { throw new EvaluationException ( eachCommand . getVar ( ) + TieConstants . EACH_COMMAND_INVALID_MSG ) ; } List collectionList = ( List ) lastCollection ; // the object must support empty constructor. collectionList . remove ( lastCollectionIndex ) ; dataContext . remove ( eachCommand . getVar ( ) ) ; }
Delete object in context .