public class OverloadedMethodsModel extends Object implements TemplateMethodModelEx, TemplateSequenceModel
TemplateMethodModelinterface, like if it was a single method, chooses among them behind the scenes on call-time based on the argument values.
|Modifier and Type||Method and Description|
Invokes the method, passing it the arguments from the list.
Retrieves the i-th template model in this sequence.
public Object exec(List arguments) throws TemplateModelException
TemplateModel-s, containing the arguments passed to the method. If the implementation absolutely wants to operate on POJOs, it can use the static utility methods in the
DeepUnwrapclass to easily obtain them. However, unwrapping is not always possible (or not perfectly), and isn't always efficient, so it's recommended to use the original
TemplateModelvalue as much as possible.
null. If the returned value does not implement
TemplateModel, it will be automatically wrapped using the
environment's object wrapper.
TemplateModelException- if the method cannot be chosen unambiguously.
public TemplateModel get(int index) throws TemplateModelException
nullif the index is out of bounds. Note that a
nullvalue is interpreted by FreeMarker as "variable does not exist", and accessing a missing variables is usually considered as an error in the FreeMarker Template Language, so the usage of a bad index will not remain hidden, unless the default value for that case was also specified in the template.