public interface PropertiesComponent extends Component, StaticService
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CREATED
Has the component been created as a default by
CamelContext during starting up Camel. |
static String |
DEFAULT_PREFIX_TOKEN
The default prefix token.
|
static String |
DEFAULT_SUFFIX_TOKEN
The default suffix token.
|
Modifier and Type | Method and Description |
---|---|
void |
addLocation(String location)
Adds the list of locations to the current locations, where to load properties.
|
void |
addPropertiesSource(PropertiesSource propertiesSource)
Adds a custom
PropertiesSource to use as source for loading and/or looking up property values. |
List<String> |
getLocations()
Gets the configured properties locations.
|
String |
getPrefixToken()
The value of the prefix token used to identify properties to replace.
|
String |
getSuffixToken()
The value of the suffix token used to identify properties to replace.
|
Properties |
loadProperties()
Loads the properties from the default locations.
|
String |
parseUri(String uri)
Parses the input text and resolve all property placeholders from within the text.
|
Optional<String> |
resolveProperty(String key)
Looks up the property with the given key
|
void |
setIgnoreMissingLocation(boolean ignoreMissingLocation)
Whether to silently ignore if a location cannot be located, such as a properties file not found.
|
void |
setInitialProperties(Properties initialProperties)
Sets initial properties which will be added before any property locations are loaded.
|
void |
setLocation(String location)
A list of locations to load properties.
|
void |
setOverrideProperties(Properties overrideProperties)
Sets a special list of override properties that take precedence
and will use first, if a property exist.
|
createEndpoint, createEndpoint, getExtension, getSupportedExtensions, trySetComponent, useRawUri
getCamelContext, setCamelContext, trySetCamelContext
static final String DEFAULT_PREFIX_TOKEN
static final String DEFAULT_SUFFIX_TOKEN
static final String DEFAULT_CREATED
CamelContext
during starting up Camel.String getPrefixToken()
DEFAULT_PREFIX_TOKEN
String getSuffixToken()
DEFAULT_SUFFIX_TOKEN
String parseUri(String uri)
uri
- input textIllegalArgumentException
- is thrown if error during parsingOptional<String> resolveProperty(String key)
key
- the name of the propertyProperties loadProperties()
List<String> getLocations()
PropertiesSource
.void setLocation(String location)
void addLocation(String location)
void addPropertiesSource(PropertiesSource propertiesSource)
PropertiesSource
to use as source for loading and/or looking up property values.void setIgnoreMissingLocation(boolean ignoreMissingLocation)
void setInitialProperties(Properties initialProperties)
void setOverrideProperties(Properties overrideProperties)
Apache Camel