Package net.mcreator.generator.template
Class TemplateGenerator
java.lang.Object
net.mcreator.generator.template.TemplateGenerator
-
Constructor Summary
ConstructorDescriptionTemplateGenerator
(TemplateGeneratorConfiguration templateGeneratorConfiguration, Generator generator) -
Method Summary
Modifier and TypeMethodDescriptiongenerateElementFromTemplate
(GeneratableElement element, String templateName, Map<String, Object> dataModel, String fixedVariables, IAdditionalTemplateDataProvider provider) generateFromString
(String template, Map<String, Object> dataModel) generateFromTemplate
(String templateName, Map<String, Object> dataModel) generateListItemFromTemplate
(Object item, int itemIndex, GeneratableElement element, String templateName, Map<String, Object> dataModel, String fixedVariables, IAdditionalTemplateDataProvider provider) boolean
hasTemplate
(String templateName)
-
Constructor Details
-
TemplateGenerator
public TemplateGenerator(TemplateGeneratorConfiguration templateGeneratorConfiguration, Generator generator)
-
-
Method Details
-
generateBaseFromTemplate
public String generateBaseFromTemplate(String templateName, Map<String, Object> dataModel, String fixedVariables) throws TemplateGeneratorException- Throws:
TemplateGeneratorException
-
generateElementFromTemplate
public String generateElementFromTemplate(GeneratableElement element, String templateName, Map<String, Object> dataModel, String fixedVariables, @Nullable IAdditionalTemplateDataProvider provider) throws TemplateGeneratorException- Throws:
TemplateGeneratorException
-
generateListItemFromTemplate
public String generateListItemFromTemplate(Object item, int itemIndex, GeneratableElement element, String templateName, Map<String, Object> dataModel, String fixedVariables, @Nullable IAdditionalTemplateDataProvider provider) throws TemplateGeneratorException- Throws:
TemplateGeneratorException
-
generateFromTemplate
public String generateFromTemplate(String templateName, Map<String, Object> dataModel) throws TemplateGeneratorException- Throws:
TemplateGeneratorException
-
generateFromString
public String generateFromString(String template, Map<String, Object> dataModel) throws TemplateGeneratorException- Throws:
TemplateGeneratorException
-
hasTemplate
-