* Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
They are used in templates like
<@myDirective foo=1 bar="wombat">...</@myDirective> (or as
<@myDirective foo=1 bar="wombat" /> - the nested content is optional).
envthe current processing environment. Note that you can access the output
paramsthe parameters (if any) passed to the directive as a map of key/value pairs where the keys are
-s and the values are
instances. This is never
null. If you need to convert the template models to POJOs, you can use the utility methods in the
loopVarsan array that corresponds to the "loop variables", in the order as they appear in the directive call. ("Loop variables" are out-parameters that are available to the nested body of the directive; see in the Manual.) You set the loop variables by writing this array. The length of the array gives the number of loop-variables that the caller has specified. Never
null, but can be a zero-length array.
bodyan object that can be used to render the nested content (body) of the directive call. If the directive call has no nested content (i.e., it's like <@myDirective /> or <@myDirective></@myDirective>), then this will be
TemplateExceptionIf any problem occurs that's not an
during writing the template output.
java.io.IOExceptionWhen writing the template output fails.