Map keys are constrained to the character set [\w.] by converting characters outside of that range to underscores. The putAll methods return a map describing keys that have been renamed according to this algorithm.
References look like ${this} or ${-this} or ${!this}. If the map element ('this' in these examples) is set, these references will all expand to the same exact thing (obviously the value of the map element with key 'this'). The difference only applies if there is no map element with key 'this'. In that case, ${this} remains exactly as it was (the input Creole is not changed at all); ${-this} is removed (i.e. replace with an empty string); and ${!this} will cause the expand() method to throw.
I would much prefer to write this with Groovy, but GroovyDoc sucks and I want to provide a real API Spec for integrators to work from.
Nested definitions, like a map value containing '${ref}', are supported, but the nested values are de-referenced by the put* methods, not in the expand method. Therefore, they are dereferenced at setup time, not at expand time. Consequently, if you use putAll() call with intra-references, you must ensure that you use an order-preserving Map implementation, and that the referents' values are completely defined before the referers. Two other ways to satisfy this use-case are to use your own loop and call put*() instead of putAll(); or to move referred-to definitions into an additional map that is fed to putAll() before your main map.
The escape mechanism is \${, \$[, \$(. All that will happen is the backslash there will be removed. @author Blaine Simpson (blaine dot simpson at admc dot com) @since 1.1.2
|
|