CHAPTER 3

image

Passing Parameters to Scripts

In this chapter, you will learn:

  • Classes used in passing parameters from Java programs to scripts
  • How to create and use Bindings object to hold the parameters
  • How to define the scope of parameters
  • How to pass parameters to scripts using different objects and scopes
  • The advantages and disadvantages of different ways of passing parameters
  • How to write script’s output to a file

Bindings, Scope, and Context

To understand the details of the parameter passing mechanism, three terms must be understood clearly: bindings, scope, and context. These terms are confusing at first. This chapter explains the parameter ...

Get Scripting in Java: Integrating with Groovy and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.