Coinjema allows for pluggable script "Evaluators" to be registered that Coinjema then uses to create injection objects for your classes. Currently there are 4 evaluators, and they are:
- .groovy - evaluates groovy script and returns the result object. ".groovy" refers to the file extension that triggers the use of this evaluator.
- .groovyClass - evaluates a groovy file as a class defined in groovy. Instantiates the class and returns the new object.
- .groovySql - evaluates a groovy script to a String which is then treated as an SQL statement and executed. A datasource is expected to be defined in a coinjema config file named "coinjema.dataSource". Most likely using the groovy evaluator (ie "coinjema.dataSource.groovy"). The results of the SQL query are converted into a single object (if a single row and column are returned), or a List (if a single column but multiple rows), or a Map<String,Object> (if multiple columns and a single row are returned) or a List of Map<String,Object>.
- .properties - reads the file as a standard properties file and returns an object
of type java.util.Properties. See also the
.inherit - .gproperties - reads the file as a standard properties file, but tries to interpret
each key and value as a groovy script that returns a String. Returns an object
of type java.util.Properties. See also the
.inherit - .txt - reads the file contents as a String object
- .jser - reads the file as a serialized Java object. The object is deserialized, and automatically dependency-injected by Coinjema1
- .compmap - properties file format that is translated into a Map object with String keys pointing to shared object dependencies. Kind of like a collection of .redirect
- .redirect - redirects to the injection object created by a different file. See More Information
