Class BambooYamlSpecsServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.configuration.external.yaml.BambooYamlSpecsServiceImpl
-
- All Implemented Interfaces:
BambooYamlSpecsService
public class BambooYamlSpecsServiceImpl extends Object implements BambooYamlSpecsService
-
-
Constructor Summary
Constructors Constructor Description BambooYamlSpecsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull BambooYamlEntityType
determineEntityType(@NotNull Map<String,Object> yamlStructure)
Determine YAML entity type which is defined in a given YAML document.@NotNull BambooYamlVersion
determineVersion(@NotNull Map<String,Object> yamlStructure)
Determine YAML version in a document from the given YAML structure.@NotNull List<Map<String,Object>>
splitDocuments(@NotNull String yamlString, @Nullable Path yamlDirectory)
Splits the givenyamlString
into multiple documents, converting them toMap
entities.
-
-
-
Method Detail
-
splitDocuments
@NotNull public @NotNull List<Map<String,Object>> splitDocuments(@NotNull @NotNull String yamlString, @Nullable @Nullable Path yamlDirectory)
Description copied from interface:BambooYamlSpecsService
Splits the givenyamlString
into multiple documents, converting them toMap
entities. No additional processing of the YAML is occurring in this step.- Specified by:
splitDocuments
in interfaceBambooYamlSpecsService
- Parameters:
yamlString
- YAML string representing an entire YAML file, may define multiple documentsyamlDirectory
- YAML directory in case of using include files- Returns:
- a list of Java
Map
s created by parsing each YAML document
-
determineVersion
@NotNull public @NotNull BambooYamlVersion determineVersion(@NotNull @NotNull Map<String,Object> yamlStructure) throws YamlSpecsValidationException
Description copied from interface:BambooYamlSpecsService
Determine YAML version in a document from the given YAML structure.- Specified by:
determineVersion
in interfaceBambooYamlSpecsService
- Parameters:
yamlStructure
- structure of a parsed YAML document- Returns:
- version of the YAML document
- Throws:
YamlSpecsValidationException
- if the version is invalid
-
determineEntityType
@NotNull public @NotNull BambooYamlEntityType determineEntityType(@NotNull @NotNull Map<String,Object> yamlStructure) throws YamlSpecsValidationException
Description copied from interface:BambooYamlSpecsService
Determine YAML entity type which is defined in a given YAML document.- Specified by:
determineEntityType
in interfaceBambooYamlSpecsService
- Parameters:
yamlStructure
- structure of a parsed YAML document- Returns:
- entity type defined in the YAML document
- Throws:
YamlSpecsValidationException
- if the entity type can't be determined
-
-