Having examined the framework in which a custom policy works, the final step before any scripts can be written is to understand the language limitations in more detail. As previously mentioned the Groovy gets converted to a Java class, specifically the innards of a Java method. This means that the Groovy code can only reflect what Java allows syntactically inside the method. The common errors as result of this are:
- Use of imports: An import statement is not possible. So, any class that needs to be used can only be addressed using the full name. For example, using a HashMap must be referred to as java.util.HashMap.
- Classes: Classes can only be defined as inner anonymous classes in the following ...