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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.