Package org.mapstruct.ap.internal.writer
Class ModelIncludeDirective
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.ModelIncludeDirective
-
- All Implemented Interfaces:
freemarker.template.TemplateDirectiveModel,freemarker.template.TemplateModel
public class ModelIncludeDirective extends java.lang.Object implements freemarker.template.TemplateDirectiveModelATemplateDirectiveModelwhich allows to recursively write a graph ofWritables, with each element using its own template. Elements are imported into the parent template by using this directive like so:<@includeModel object=myProperty/>.
-
-
Field Summary
Fields Modifier and Type Field Description private freemarker.template.Configurationconfiguration
-
Constructor Summary
Constructors Constructor Description ModelIncludeDirective(freemarker.template.Configuration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ModelWriter.DefaultModelElementWriterContextcreateContext(java.util.Map params)Creates a writer context providing access to the FreeMarkerConfigurationand a map with any additional parameters passed to the directive.voidexecute(freemarker.core.Environment env, java.util.Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body)private WritablegetModelElement(java.util.Map params)
-
-
-
Method Detail
-
execute
public void execute(freemarker.core.Environment env, java.util.Map params, freemarker.template.TemplateModel[] loopVars, freemarker.template.TemplateDirectiveBody body) throws freemarker.template.TemplateException, java.io.IOException- Specified by:
executein interfacefreemarker.template.TemplateDirectiveModel- Throws:
freemarker.template.TemplateExceptionjava.io.IOException
-
getModelElement
private Writable getModelElement(java.util.Map params)
-
createContext
private ModelWriter.DefaultModelElementWriterContext createContext(java.util.Map params)
Creates a writer context providing access to the FreeMarkerConfigurationand a map with any additional parameters passed to the directive.- Parameters:
params- The parameter map passed to this directive.- Returns:
- A writer context.
-
-