Package org.apache.camel.spi
Interface LanguageCustomizer
-
- 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 LanguageCustomizer extends Ordered
To apply custom configurations toLanguage
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LanguageCustomizer.Builder<T extends Language>
A fluent builder to create aLanguageCustomizer
instance.static interface
LanguageCustomizer.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 LanguageCustomizer.Builder<Language>
builder()
Create a genericLanguageCustomizer.Builder
.static <T extends Language>
LanguageCustomizer.Builder<T>builder(Class<T> type)
Create a typedLanguageCustomizer.Builder
that can process a concrete language type instance.void
configure(String name, Language target)
Customize the specifiedLanguage
.static <T extends Language>
LanguageCustomizerforType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T,Exception> consumer)
Create aDataFormatCustomizer
that can process a concrete language type instance.default int
getOrder()
Gets the order.default boolean
isEnabled(String name, Language target)
Checks whether this customizer should be applied to the givenLanguage
.
-
-
-
Method Detail
-
builder
static LanguageCustomizer.Builder<Language> builder()
Create a genericLanguageCustomizer.Builder
.- Returns:
- the
LanguageCustomizer.Builder
-
builder
static <T extends Language> LanguageCustomizer.Builder<T> builder(Class<T> type)
Create a typedLanguageCustomizer.Builder
that can process a concrete language type instance.- Parameters:
type
- the concrete type of theComponent
- Returns:
- the
ComponentCustomizer.Builder
-
forType
static <T extends Language> LanguageCustomizer forType(Class<T> type, org.apache.camel.util.function.ThrowingConsumer<T,Exception> consumer)
Create aDataFormatCustomizer
that can process a concrete language type instance.- Parameters:
type
- the concrete type of theLanguage
consumer
- theLanguage
configuration logic- Returns:
- the
LanguageCustomizer
-
configure
void configure(String name, Language target)
Customize the specifiedLanguage
.- Parameters:
name
- the unique name of the languagetarget
- the language to configure
-
isEnabled
default boolean isEnabled(String name, Language target)
Checks whether this customizer should be applied to the givenLanguage
.- Parameters:
name
- the unique name of the languagetarget
- the language 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
.
-
-