Interface PropertyConfigurerGetter

All Known Subinterfaces:
ExtendedPropertyConfigurerGetter

public interface PropertyConfigurerGetter
Extension of the configurer SPI that, in addition to setting properties, can describe the options a target supports.

Where PropertyConfigurer only writes property values, a getter can report each option's type (getOptionType(String, boolean)), read the current value (getOptionValue(Object, String, boolean)), resolve the element type of collection options (getCollectionValueType(Object, String, boolean)), and list autowired options (getAutowiredNames()). Generated configurers typically implement this so tooling and the property-binding engine can introspect components and endpoints. ExtendedPropertyConfigurerGetter adds enumeration of all options.

See Property Binding in the Camel user manual.

Since:
3.2
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default String @Nullable []
    Gets the names of the autowired options.
    default @Nullable Object
    getCollectionValueType(Object target, String name, boolean ignoreCase)
    This method can be used to retrieve the class type for an option if the option is a collection kind (list, map, or array).
    @Nullable Class<?>
    getOptionType(String name, boolean ignoreCase)
    Gets the option class type.
    @Nullable Object
    getOptionValue(Object target, String name, boolean ignoreCase)
    Gets the property value
  • Method Details

    • getOptionType

      @Nullable Class<?> getOptionType(String name, boolean ignoreCase)
      Gets the option class type.
      Parameters:
      name - the property name
      ignoreCase - whether to ignore case for matching the property name
      Returns:
      the class type, or null if no option exists with the name
    • getAutowiredNames

      default String @Nullable [] getAutowiredNames()
      Gets the names of the autowired options.
      Returns:
      the names as an array, or null if there are no autowire options.
    • getCollectionValueType

      default @Nullable Object getCollectionValueType(Object target, String name, boolean ignoreCase)
      This method can be used to retrieve the class type for an option if the option is a collection kind (list, map, or array). For maps, then the nested type returned is the type of the value in the map (not the map key type).
      Parameters:
      target - the target instance such as Endpoint or Component.
      name - the property name
      ignoreCase - whether to ignore case for matching the property name
      Returns:
      the class type, or null if the option is not a collection kind or not possible to determine
    • getOptionValue

      @Nullable Object getOptionValue(Object target, String name, boolean ignoreCase)
      Gets the property value
      Parameters:
      target - the target instance such as Endpoint or Component.
      name - the property name
      ignoreCase - whether to ignore case for matching the property name
      Returns:
      the property value