Package org.apache.camel.spi
Interface DataFormatCustomizer
- All Superinterfaces:
Ordered
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
To apply custom configurations to
DataFormat
instances.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
DataFormatCustomizer.Builder<T extends DataFormat>
A fluent builder to create aDataFormatCustomizer
instance.static interface
Used as additional filer mechanism to control if customizers need to be applied or not. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a genericDataFormatCustomizer.Builder
.static <T extends DataFormat>
DataFormatCustomizer.Builder<T> Create a typedDataFormatCustomizer.Builder
that can process a concrete data format type instance.void
configure
(String name, DataFormat target) Customize the specifiedDataFormat
.static <T extends DataFormat>
DataFormatCustomizerCreate aDataFormatCustomizer
that can process a concrete data format type instance.default int
getOrder()
Gets the order.default boolean
isEnabled
(String name, DataFormat target) Checks whether this customizer should be applied to the givenDataFormat
.
-
Method Details
-
builder
Create a genericDataFormatCustomizer.Builder
.- Returns:
- the
DataFormatCustomizer.Builder
-
builder
Create a typedDataFormatCustomizer.Builder
that can process a concrete data format type instance.- Parameters:
type
- the concrete type of theComponent
- Returns:
- the
ComponentCustomizer.Builder
-
forType
static <T extends DataFormat> DataFormatCustomizer forType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T, Exception> consumer) Create aDataFormatCustomizer
that can process a concrete data format type instance.- Parameters:
type
- the concrete type of theDataFormat
consumer
- theDataFormat
configuration logic- Returns:
- the
DataFormatCustomizer
-
configure
Customize the specifiedDataFormat
.- Parameters:
name
- the unique name of the data formattarget
- the data format to configure
-
isEnabled
Checks whether this customizer should be applied to the givenDataFormat
.- Parameters:
name
- the unique name of the data formattarget
- the data format to configure- Returns:
- true if the customizer should be applied
-
getOrder
default int getOrder()Description copied from interface:Ordered
Gets the order. Use low numbers for higher priority. Normally the sorting will start from 0 and move upwards. So if you want to be last then useInteger.MAX_VALUE
or egOrdered.LOWEST
.
-