null the next
rule found will be visited. If none of the rules can handle the conversion,
the original converter will be used to perform the conversion.
| Modifier and Type | Method and Description |
|---|---|
| public Converter | Returns: A new converter with the rules provided to the builder.Build the specified converter. |
| public ConverterBuilder | Returns: This converter builder for further building.The function to be used to handle errors. func)Register a custom error handler. |
| public ConverterBuilder | Returns: This converter builder for further building.The type that this rule will produce. type, ConverterFunction The function that will handle the conversion. func)Register a conversion rule for this converter. |
| public ConverterBuilder | Returns: This converter builder for further building.A rule implementation. rule)Register a conversion rule for this converter. |
| public ConverterBuilder | Returns: This converter builder for further building.The function that will handle the conversion. func)Register a catch-all rule, will be called of no other rule matches. |
| build | back to summary |
|---|---|
| public Converter build() 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) 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.
| |
| rule | back to summary |
|---|---|
| public ConverterBuilder rule(Type type, ConverterFunction func) 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) Register a conversion rule for this converter.
| |
| rule | back to summary |
|---|---|
| public ConverterBuilder rule(ConverterFunction func) Register a catch-all rule, will be called of no other rule matches.
| |