Groovy 2 Cookbook
Java and Groovy go together like ham and eggs, and this book is a great opportunity to learn how to exploit Groovy 2 to the full. Packed with recipes, both intermediate and advanced, it’s a great way to speed up and modernize your programming. Simple and more advanced recipes to cover a broad number...
Autor principal: | |
---|---|
Otros Autores: | |
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing
2013.
|
Edición: | 1st edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009628109306719 |
Tabla de Contenidos:
- Intro
- Groovy 2 Cookbook
- Table of Contents
- Groovy 2 Cookbook
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Support files, eBooks, discount offers and more
- Why Subscribe?
- Free Access for Packt account holders
- Preface
- The Groovy language
- What this book covers
- What you need for this book
- Who this book is for
- Conventions
- Reader feedback
- Customer support
- Downloading the example code
- Errata
- Piracy
- Questions
- 1. Getting Started with Groovy
- Introduction
- Installing Groovy on Windows
- Getting ready
- How to do it…
- There's more...
- Installing Groovy on Linux and OS X
- How to do it...
- How it works...
- There's more...
- See also
- Executing Groovy code from the command line
- How to do it...
- How it works...
- There's more...
- See also
- Using Groovy as a command-line text file editor
- How to do it...
- How it works...
- There's more...
- See also
- Using Groovy to start a server on the command line
- How to do it...
- See also
- Running Groovy with invokedynamic support
- Getting ready
- How to do it...
- There's more...
- See also
- Building Groovy from source
- Getting ready
- How to do it...
- How it works...
- Managing multiple Groovy installations on Linux
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Using groovysh to try out Groovy commands
- How to do it...
- How it works...
- There's more...
- Starting groovyConsole to execute Groovy snippets
- How to do it...
- There's more...
- Configuring Groovy in Eclipse
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Configuring Groovy in IntelliJ IDEA
- Getting ready
- How to do it...
- There's more...
- 2. Using Groovy Ecosystem
- Introduction
- Using Java classes from Groovy.
- How to do it...
- How it works...
- There's more...
- See also
- Embedding Groovy into Java
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Compiling Groovy code
- Getting ready
- How to do it...
- How it works...
- See also
- Simplifying dependency management with Grape
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Integrating Groovy into the build process using Ant
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Integrating Groovy into the build process using Maven
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Integrating Groovy into the build process using Gradle
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Generating documentation for Groovy code
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Checking Groovy code's quality with CodeNarc
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- 3. Using Groovy Language Features
- Introduction
- Searching strings with regular expressions
- Getting ready
- How to do it...
- There's more...
- See also
- Writing less verbose Java Beans with Groovy Beans
- Getting ready
- How to do it...
- How it works...
- There's more...
- Inheriting constructors in Groovy classes
- How to do it...
- How it works...
- Adding the cloning functionality to Groovy Beans
- How to do it...
- How it works...
- There's more...
- Defining code as data in Groovy
- Getting ready
- How to do it...
- There's more...
- Defining data structures as code in Groovy
- Getting ready
- How to do it...
- How it works...
- See also
- Implementing multiple inheritance in Groovy
- Getting ready
- How to do it.
- How it works...
- There's more...
- See also
- Adding a functionality to the existing Java/Groovy classes
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Defining type-checking rules for dynamic code
- Getting ready
- How to do it...
- How it works...
- There's more...
- Adding automatic logging to Groovy classes
- How to do it...
- How it works...
- There's more...
- See also
- 4. Working with Files in Groovy
- Introduction
- Reading from a file
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Reading a text file line by line
- Getting ready
- How to do it...
- There's more...
- See also
- Processing every word in a text file
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Writing to a file
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Replacing tabs with spaces in a text file
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Filtering a text file's content
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Deleting a file or directory
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Walking through a directory recursively
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Searching for files
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Changing file attributes on Windows
- Getting ready
- How to do it...
- How it works...
- There's more...
- Reading data from a ZIP file
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Reading an Excel file
- Getting ready
- How to do it...
- How it works...
- See also.
- Extracting data from a PDF
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- 5. Working with XML in Groovy
- Introduction
- Reading XML using XmlSlurper
- Getting ready
- How to do it...
- How it works...
- See also
- Reading XML using XmlParser
- How to do it...
- How it works...
- See also
- Reading XML content with namespaces
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Searching in XML with GPath
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Searching in XML with XPath
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Constructing XML content
- How to do it...
- How it works...
- There's more...
- See also
- Modifying XML content
- Getting ready
- How to do it...
- How it works...
- See also
- Sorting XML nodes
- How to do it...
- How it works...
- There's more...
- See also
- Serializing Groovy Beans to XML
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- 6. Working with JSON in Groovy
- Introduction
- Parsing JSON messages with JsonSlurper
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Constructing JSON messages with JsonBuilder
- How to do it...
- How it works...
- See also
- Modifying JSON messages
- How to do it...
- How it works...
- See also
- Validating JSON messages
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Converting JSON message to XML
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Converting JSON message to Groovy Bean
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Using JSON to configure your scripts
- Getting ready.
- How to do it...
- How it works...
- There's more...
- See also
- 7. Working with Databases in Groovy
- Introduction
- Creating a database table
- Getting ready
- How to do it...
- How it works...
- See also
- Connecting to an SQL database
- Getting ready
- How to do it...
- How it works...
- See also
- Querying an SQL database
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Modifying data in an SQL database
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Calling a stored procedure
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Reading BLOB/CLOB from a database
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Building a simple ORM framework
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Using Groovy to access Redis
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Using Groovy to access MongoDB
- Getting ready
- How to do it...
- How it works...
- There's more...
- See also
- Using Groovy to access Apache Cassandra
- Getting ready
- How to do it...
- How it works...
- See also
- 8. Working with Web Services in Groovy
- Introduction
- Downloading content from the Internet
- How to do it...
- How it works...
- There's more...
- See also
- Executing an HTTP GET request
- How to do it...
- How it works...
- There's more...
- See also
- Executing an HTTP POST request
- How to do it...
- How it works...
- There's more...
- See also
- Constructing and modifying complex URLs
- How to do it...
- How it works...
- See also
- Issuing a REST request and parsing a response
- Getting ready
- How to do it...
- How it works...
- See also.
- Issuing a SOAP request and parsing a response.