| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final InternalConverter | |
| private final List | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public InternalConverter | |
| public ConverterBuilder | errorHandler(ConverterFunction
The function to be used to handle errors. func)Implements org. Register a custom error handler. |
| private List | |
| public ConverterBuilder | rule(ConverterFunction
The function that will handle the conversion. func)Implements org. Register a catch-all rule, will be called of no other rule matches. |
| public ConverterBuilder | rule(Type
The type that this rule will produce. t, ConverterFunction The function that will handle the conversion. func)Implements org. Register a conversion rule for this converter. |
| public ConverterBuilder | rule(TargetRule
A rule implementation. rule)Implements org. Register a conversion rule for this converter. |
| catchAllRules | back to summary |
|---|---|
| private final List<ConverterFunction> catchAllRules | |
| converter | back to summary |
|---|---|
| private final InternalConverter converter | |
| errorHandlers | back to summary |
|---|---|
| private final List<ConverterFunction> errorHandlers | |
| rules | back to summary |
|---|---|
| private final Map<Type, List<ConverterFunction>> rules | |
| ConverterBuilderImpl | back to summary |
|---|---|
| public ConverterBuilderImpl(InternalConverter c) | |
| build | back to summary |
|---|---|
| public InternalConverter build() Implements org. Doc from org. Build the specified converter. Each time this method is called a new custom converter is produced based on the rules registered with the builder.
| |
| errorHandler | back to summary |
|---|---|
| public ConverterBuilder errorHandler(ConverterFunction func) Implements org. Doc from org. Register a custom error handler. The custom error handler will be called when the conversion would otherwise throw an exception. The error handler can either throw a different exception or return a value to be used for the failed conversion.
| |
| getRulesList | back to summary |
|---|---|
| private List | |
| rule | back to summary |
|---|---|
| public ConverterBuilder rule(ConverterFunction func) Implements org. Doc from org. Register a catch-all rule, will be called of no other rule matches.
| |
| rule | back to summary |
|---|---|
| public ConverterBuilder rule(Type t, ConverterFunction func) Implements org. Doc from org. Register a conversion rule for this converter. Note that only the target type is specified, so the rule will be visited for every conversion to the target type.
| |
| rule | back to summary |
|---|---|
| public ConverterBuilder rule(TargetRule rule) Implements org. Doc from org. Register a conversion rule for this converter.
| |