@ JSFunction ( "getReader" ) public Object getJSReader ( ) { if ( reader == null ) return null ; // Here we use toObject() to "wrap" the BufferedReader object // in a Scriptable object so that it can be manipulated by // JavaScript. Scriptable parent = ScriptableObject . getTopLevelScope ( this ) ; return Context . javaToJS ( reader , parent ) ; }
Get the Java reader .