Package org.mapstruct.ap.internal.writer
Class FreeMarkerWritable
java.lang.Object
org.mapstruct.ap.internal.writer.FreeMarkerWritable
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
ModelElement
A
Writable which uses the FreeMarker template engine to generate the output.- Author:
- Gunnar Morling
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the name of the template to be used for a specific writable type.protected StringgetTemplateNameForClass(Class<?> clazz) Returns the name of the template to be used for a specific writable type.voidwrite(Writable.Context context, Writer writer) Writes this element to the given writer.
-
Constructor Details
-
FreeMarkerWritable
public FreeMarkerWritable()
-
-
Method Details
-
write
Description copied from interface:WritableWrites this element to the given writer. -
getTemplateName
Returns the name of the template to be used for a specific writable type. By default,getTemplateNameForClass(Class)is called withgetClass(), but this can be customized by overriding this method if required.- Returns:
- the name of the template. Must not be
null.
-
getTemplateNameForClass
Returns the name of the template to be used for a specific writable type. By default, the package directory and the class name of the given model element type, appended with the extension*.ftlis used as template file name.- Parameters:
clazz- class to obtain a template for- Returns:
- the name of the template. Must not be
null.
-