Interface PropertiesSource

All Known Subinterfaces:
LoadablePropertiesSource

public interface PropertiesSource
A source of property values for the Camel PropertiesComponent when resolving property placeholders.

The properties component consults all registered sources (system properties, environment variables, .properties files, beans, vaults, and so on) to resolve a placeholder. A source can implement Ordered to control its precedence; the source with the highest precedence (the lowest number) is consulted first. Sources whose properties can be loaded eagerly in bulk implement LoadablePropertiesSource, and the built-in sources are created via PropertiesSourceFactory.

See Using PropertyPlaceholder in the Camel user manual.

Since:
3.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    The name of this properties source.
    @Nullable String
    Gets the property with the name
    default @Nullable String
    getProperty(String name, @Nullable String defaultValue)
    Gets the property with the name
  • Method Details

    • getName

      String getName()
      The name of this properties source.
      Returns:
      the source name
    • getProperty

      @Nullable String getProperty(String name)
      Gets the property with the name
      Parameters:
      name - name of property
      Returns:
      the property value, or null if no property exists
    • getProperty

      default @Nullable String getProperty(String name, @Nullable String defaultValue)
      Gets the property with the name
      Parameters:
      name - name of property
      defaultValue - default value to use as fallback
      Returns:
      the property value, or null if no property exists