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.
@FunctionalInterface public interface DataFormatCustomizer extends Ordered
To apply custom configurations toDataFormat
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DataFormatCustomizer.Builder<T extends DataFormat>
A fluent builder to create aDataFormatCustomizer
instance.static interface
DataFormatCustomizer.Policy
Used as additional filer mechanism to control if customizers need to be applied or not.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static DataFormatCustomizer.Builder<DataFormat>
builder()
Create a genericDataFormatCustomizer.Builder
.static <T extends DataFormat>
DataFormatCustomizer.Builder<T>builder(Class<T> type)
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>
DataFormatCustomizerforType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T,Exception> consumer)
Create 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 Detail
-
builder
static DataFormatCustomizer.Builder<DataFormat> builder()
Create a genericDataFormatCustomizer.Builder
.- Returns:
- the
DataFormatCustomizer.Builder
-
builder
static <T extends DataFormat> DataFormatCustomizer.Builder<T> builder(Class<T> type)
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
void configure(String name, DataFormat target)
Customize the specifiedDataFormat
.- Parameters:
name
- the unique name of the data formattarget
- the data format to configure
-
isEnabled
default boolean isEnabled(String name, DataFormat target)
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
.
-
-