Scripting in Java [electronic resource] : Integrating with Groovy and JavaScript /
Sharan, Kishori.author.
Scripting in Java teaches you how to use the Java Scripting API and JavaScript to execute scripts and take advantage of the features of a scripting language while developing Java applications. The book also covers topics that enable scripting languages to take advantage of Java features and the Java class library, including the new Java Collections and JavaFX 8 APIs. Most of the examples in this book use JavaScript on the Nashorn engine. Author Kishori Sharan will show you scripts in JavaScript to demonstrate its power and use in your Java applications. Some of the examples use the jrunscript and jjs command-line tools. Furthermore, debugging is discussed to equip you for situations when or if you encounter any issues with this kind of Java scripting. After reading and using this book, you will have most of what you need to do scripting in Java.
Contents at a Glance; Contents; About the Author; About the Technical Reviewers; Acknowledgments; Introduction; Chapter 1: Getting Started; What Is Scripting in Java?; Executing Your First Script; Using the jjs Command-line Tool; Printing Text in Nashorn; Using Other Scripting Languages; Exploring the javax.script Package; The ScriptEngine and ScriptEngineFactory Interfaces; The AbstractScriptEngine Class; The ScriptEngineManager Class; The Compilable Interface and the CompiledScript Class; The Invocable Interface; The Bindings Interface and the SimpleBindings Class
Changing the Default ScriptContextSending Scripts Output to a File; Summary; Chapter 4: Writing Scripts in Nashorn; Strict and Nonstrict Modes; Identifiers; Comments; Declaring Variables; Data Types; The Undefined Type; The Null Type; The Number Type; The Boolean Type; The String Type; Operators; Type Conversion; To Boolean Conversion; To Number Conversion; To String Conversion; Statements; Block Statement; Variable Statement; Empty Statement; Expression Statement; The if Statement; Iteration Statements; The continue, break, and return Statements; The with Statement; The switch Statement
Invoking Procedures in Scripts
"Write Scripts in Java 8 using the New Nashorn Scripting Engine"--Cover.
Includes index.
Scripting in Java teaches you how to use the Java Scripting API and JavaScript to execute scripts and take advantage of the features of a scripting language while developing Java applications. The book also covers topics that enable scripting languages to take advantage of Java features and the Java class library, including the new Java Collections and JavaFX 8 APIs. Most of the examples in this book use JavaScript on the Nashorn engine. Author Kishori Sharan will show you scripts in JavaScript to demonstrate its power and use in your Java applications. Some of the examples use the jrunscript and jjs command-line tools. Furthermore, debugging is discussed to equip you for situations when or if you encounter any issues with this kind of Java scripting. After reading and using this book, you will have most of what you need to do scripting in Java.
Java (Computer program language).
Software engineering.
Java.
Software Engineering/Programming and Operating Systems.