public class YamlPropertiesFactoryBean extends YamlProcessor implements FactoryBean<Properties>
environments: dev: url: http://dev.bar.com name: Developer Setup prod: url: http://foo.bar.com name: My Cool Appis transformed into these Properties:
environments.dev.url=http://dev.bar.com environments.dev.name=Developer Setup environments.prod.url=http://foo.bar.com environments.prod.name=My Cool AppLists are represented as comma-separated values (useful for simple String values) and also as property keys with
[]
dereferencers, for example this YAML:
servers: - dev.bar.com - foo.bar.combecomes java Properties like this:
servers=dev.bar.com,foo.bar.com servers[0]=dev.bar.com servers[1]=foo.bar.com
YamlProcessor.DocumentMatcher, YamlProcessor.MatchCallback, YamlProcessor.MatchStatus, YamlProcessor.ResolutionMethod
Constructor and Description |
---|
YamlPropertiesFactoryBean() |
Modifier and Type | Method and Description |
---|---|
Properties |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setSingleton(boolean singleton)
Set if a singleton should be created, or a new object on each request otherwise.
|
process, setDocumentMatchers, setMatchDefault, setResolutionMethod, setResources
public Properties getObject()
getObject
in interface FactoryBean<Properties>
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<Properties>
public void setSingleton(boolean singleton)
true
(a singleton).public boolean isSingleton()
isSingleton
in interface FactoryBean<Properties>
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.