Groovy Transformation and Aggregation Operations
The Java interfaces defining the allowed operations for Transformation and Aggregation are shared with the Groovy language.
As a result, all the operations present in Java are also available in Groovy. Specific shortcuts are however available in Groovy only:
-
You can access all getters directly without specifying a method call and the
get
prefix. For example, you can rewriteit.getUri()
asit.uri
. -
You can also access the following properties with similar shorthands:
-
it.metas
: The document metadata. For example,it.metas.company_name
returns a Groovy list of strings containing the meta values for thecompany_name
meta. You can also specify the meta name between quotes. So you could writeit.metas."company_name"
. It is even more interesting to make it dynamic by writingit.metas."$myVar"
, where the variable''myVar''
would be defined with the assignmentmyVar = "company_name"
. -
it.directives
: The document directives. Usage is similar toit.metas
. -
it.parts
: The document parts. Usage is similar toit.metas
except that values are now instances ofIDocumentPart
as in Java.
-