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 toDataFormatinstances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDataFormatCustomizer.Builder<T extends DataFormat>A fluent builder to create aDataFormatCustomizerinstance.static interfaceDataFormatCustomizer.PolicyUsed 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.Builderthat can process a concrete data format type instance.voidconfigure(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 aDataFormatCustomizerthat can process a concrete data format type instance.default intgetOrder()Gets the order.default booleanisEnabled(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.Builderthat 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 aDataFormatCustomizerthat can process a concrete data format type instance.- Parameters:
type- the concrete type of theDataFormatconsumer- theDataFormatconfiguration 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:OrderedGets 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_VALUEor egOrdered.LOWEST.
-
-