Class NexusTemplateServiceImpl
java.lang.Object
org.eclipse.dawnsci.nexus.template.impl.NexusTemplateServiceImpl
- All Implemented Interfaces:
NexusTemplateService
Implementation of the template service, uses SnakeYaml to read the template file internally.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTemplate(String templateName, Map<String, Object> templateMap) Creates a template from the given template map.createTemplateFromString(String templateString) Creates a template from the given template string.loadTemplate(String templateFilePath) Loads a template from the given file path.
-
Constructor Details
-
NexusTemplateServiceImpl
public NexusTemplateServiceImpl()
-
-
Method Details
-
loadTemplate
Description copied from interface:NexusTemplateServiceLoads a template from the given file path. The file must be in YAML format.- Specified by:
loadTemplatein interfaceNexusTemplateService- Parameters:
templateFilePath- template file path- Returns:
- the template created
- Throws:
NexusException- if the template could not be loaded for any reason
-
createTemplate
Description copied from interface:NexusTemplateServiceCreates a template from the given template map. The map is a potentially nested map of template entries - see the template documentation for more details.- Specified by:
createTemplatein interfaceNexusTemplateService- Parameters:
templateName- the name of the templatetemplateMap- the yaml mapping- Returns:
- the template created
-
createTemplateFromString
Description copied from interface:NexusTemplateServiceCreates a template from the given template string. The string must be in YAML format.- Specified by:
createTemplateFromStringin interfaceNexusTemplateService- Parameters:
templateString- the template string to load- Returns:
- the template created
- Throws:
NexusException- if the template could not be created for any reason
-