Requires SnakeYAML 2.0 or higher, as of Spring Framework 6.1.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | YamlProcessor.DocumentMatcher
Strategy interface used to test if properties match. |
| public static interface | YamlProcessor.MatchCallback
Callback interface used to process the YAML parsing results. |
| public static enum | YamlProcessor.MatchStatus
Status returned from |
| public static enum | YamlProcessor.ResolutionMethod
Method to use for resolving resources. |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private final Log | |
| private boolean | |
| private YamlProcessor. | |
| private Resource[] | |
| private Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Map | |
| private void | |
| protected Yaml | |
| protected final Map | Returns: a flattened mapthe source map source)Return a flattened version of the given map, recursively following any nested Map or Collection values. |
| private void | |
| protected void | process(YamlProcessor.
a callback to delegate to once matching documents are found callbackProvide an opportunity for subclasses to process the Yaml parsed from the supplied resources. |
| private boolean | |
| private boolean | |
| public void | setDocumentMatchers(YamlProcessor.
A map of document matchers allowing callers to selectively use only some of the documents in a YAML resource. |
| public void | setMatchDefault(boolean matchDefault)
Flag indicating that a document for which all the
|
| public void | setResolutionMethod(YamlProcessor.
Method to use for resolving resources. |
| public void | |
| public void | setSupportedTypes(Class<?>...
the supported types, or an empty array to clear the
supported types supportedTypes)Set the supported types that can be loaded from YAML documents. |
| documentMatchers | back to summary |
|---|---|
| private List<YamlProcessor. | |
| logger | back to summary |
|---|---|
| private final Log logger | |
| matchDefault | back to summary |
|---|---|
| private boolean matchDefault | |
| resolutionMethod | back to summary |
|---|---|
| private YamlProcessor. | |
| resources | back to summary |
|---|---|
| private Resource[] resources | |
| supportedTypes | back to summary |
|---|---|
| private Set<String> supportedTypes | |
| YamlProcessor | back to summary |
|---|---|
| public YamlProcessor() | |
| asMap | back to summary |
|---|---|
private Map
| |
| buildFlattenedMap | back to summary |
|---|---|
private void buildFlattenedMap(Map<String, Object> result, Map<String, Object> source, String path)
| |
| createYaml | back to summary |
|---|---|
| protected Yaml createYaml() Create the The default implementation sets the "allowDuplicateKeys" flag to If custom supported types have been configured,
the default implementation creates a | |
| getFlattenedMap | back to summary |
|---|---|
| protected final Map Return a flattened version of the given map, recursively following any nested Map
or Collection values. Entries from the resulting map retain the same order as the
source. When called with the Map from a | |
| handleProcessError | back to summary |
|---|---|
| private void handleProcessError(Resource resource, IOException ex) | |
| process | back to summary |
|---|---|
| protected void process(YamlProcessor. Provide an opportunity for subclasses to process the Yaml parsed from the supplied
resources. Each resource is parsed in turn and the documents inside checked against
the
| |
| process | back to summary |
|---|---|
| private boolean process(YamlProcessor. | |
| process | back to summary |
|---|---|
| private boolean process(Map<String, Object> map, YamlProcessor. | |
| setDocumentMatchers | back to summary |
|---|---|
| public void setDocumentMatchers(YamlProcessor. A map of document matchers allowing callers to selectively use only
some of the documents in a YAML resource. In YAML documents are
separated by environment: dev url: https://dev.bar.com name: Developer Setup --- environment: prod url:https://foo.bar.com name: My Cool Appwhen mapped with
setDocumentMatchers(properties ->
("prod".equals(properties.getProperty("environment")) ? MatchStatus.FOUND : MatchStatus.NOT_FOUND));
would end up as
environment=prod url=https://foo.bar.com name=My Cool App | |
| setMatchDefault | back to summary |
|---|---|
| public void setMatchDefault(boolean matchDefault) Flag indicating that a document for which all the
| |
| setResolutionMethod | back to summary |
|---|---|
| public void setResolutionMethod(YamlProcessor. Method to use for resolving resources. Each resource will be converted to a Map,
so this property is used to decide which map entries to keep in the final output
from this factory. Default is | |
| setResources | back to summary |
|---|---|
| public void setResources(Resource... resources) Set locations of YAML
| |
| setSupportedTypes | back to summary |
|---|---|
| public void setSupportedTypes(Class<?>... supportedTypes) Set the supported types that can be loaded from YAML documents. If no supported types are configured, only Java standard classes
(as defined in
| |
| Modifier and Type | Method and Description |
|---|---|
| public YamlProcessor. | Returns: the status of the matchthe properties to test properties)Test if the given properties match. |
| matches | back to summary |
|---|---|
| public YamlProcessor. Test if the given properties match.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | process(Properties
the properties to process (as a flattened
representation with indexed keys in case of a collection or map) properties, Map<String, Object> the result map (preserving the original value structure
in the YAML document) map)Process the given representation of the parsing results. |
| process | back to summary |
|---|---|
| public void process(Properties properties, Map<String, Object> map) Process the given representation of the parsing results.
| |
DocumentMatcher#matches(java.util.Properties) .
| Modifier and Type | Field and Description |
|---|---|
| public static final YamlProcessor. | ABSTAIN
The matcher should not be considered. |
| public static final YamlProcessor. | FOUND
A match was found. |
| public static final YamlProcessor. | NOT_FOUND
No match was found. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static YamlProcessor. | getMostSpecific(YamlProcessor.
Compare two |
| public static YamlProcessor. | |
| public static YamlProcessor. |
| ABSTAIN | back to summary |
|---|---|
| public static final YamlProcessor. The matcher should not be considered. | |
| FOUND | back to summary |
|---|---|
| public static final YamlProcessor. A match was found. | |
| NOT_FOUND | back to summary |
|---|---|
| public static final YamlProcessor. No match was found. | |
| MatchStatus | back to summary |
|---|---|
| private MatchStatus() | |
| getMostSpecific | back to summary |
|---|---|
| public static YamlProcessor. Compare two | |
| valueOf | back to summary |
|---|---|
| public static YamlProcessor. | |
| values | back to summary |
|---|---|
| public static YamlProcessor. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final YamlProcessor. | FIRST_FOUND
Take the first resource in the list that exists and use just that. |
| public static final YamlProcessor. | OVERRIDE
Replace values from earlier in the list. |
| public static final YamlProcessor. | OVERRIDE_AND_IGNORE
Replace values from earlier in the list, ignoring any failures. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static YamlProcessor. | |
| public static YamlProcessor. |
| FIRST_FOUND | back to summary |
|---|---|
| public static final YamlProcessor. Take the first resource in the list that exists and use just that. | |
| OVERRIDE | back to summary |
|---|---|
| public static final YamlProcessor. Replace values from earlier in the list. | |
| OVERRIDE_AND_IGNORE | back to summary |
|---|---|
| public static final YamlProcessor. Replace values from earlier in the list, ignoring any failures. | |
| ResolutionMethod | back to summary |
|---|---|
| private ResolutionMethod() | |
| valueOf | back to summary |
|---|---|
| public static YamlProcessor. | |
| values | back to summary |
|---|---|
| public static YamlProcessor. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isGlobalTagAllowed(Tag
- the global tag to check tag)Implements org. |
| SupportedTagInspector | back to summary |
|---|---|
| private SupportedTagInspector() | |
| isGlobalTagAllowed | back to summary |
|---|---|
| public boolean isGlobalTagAllowed(Tag tag) Implements org. Doc from org. Check | |