public static void addToScope ( Scriptable scope , InputRow inputRow , InputColumn < ? > [ ] columns , String arrayName ) { NativeArray values = new NativeArray ( columns . length * 2 ) ; for ( int i = 0 ; i < columns . length ; i ++ ) { InputColumn < ? > column = columns [ i ] ; Object value = inputRow . getValue ( column ) ; if ( value != null ) { Class < ? > dataType = column . getDataType ( ) ; if ( ReflectionUtils . isNumber ( dataType ) ) { value = Context . toNumber ( value ) ; } else if ( ReflectionUtils . isBoolean ( dataType ) ) { value = Context . toBoolean ( value ) ; } } values . put ( i , values , value ) ; values . put ( column . getName ( ) , values , value ) ; addToScope ( scope , value , column . getName ( ) , column . getName ( ) . toLowerCase ( ) , column . getName ( ) . toUpperCase ( ) ) ; } addToScope ( scope , values , arrayName ) ; }
Adds the values of a row to the JavaScript scope