Class BambooYamlSpecsServiceImpl
java.lang.Object
com.atlassian.bamboo.configuration.external.yaml.BambooYamlSpecsServiceImpl
- All Implemented Interfaces:
BambooYamlSpecsService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@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.splitDocuments
(@NotNull String yamlString, @Nullable Path yamlDirectory) Splits the givenyamlString
into multiple documents, converting them toMap
entities.
-
Constructor Details
-
BambooYamlSpecsServiceImpl
public BambooYamlSpecsServiceImpl()
-
-
Method Details
-
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 YamlSpecsValidationExceptionDescription 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 YamlSpecsValidationExceptionDescription 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
-