Package org.osgi.util.converter
Class CustomConverterImpl
- java.lang.Object
-
- org.osgi.util.converter.CustomConverterImpl
-
- All Implemented Interfaces:
Converter
,InternalConverter
class CustomConverterImpl extends java.lang.Object implements InternalConverter
A custom converter wraps another converter by adding rules and/or error handlers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CustomConverterImpl.ConvertingWrapper
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<ConverterFunction>
allRules
private InternalConverter
delegate
(package private) java.util.List<ConverterFunction>
errorHandlers
(package private) java.util.Map<java.lang.reflect.Type,java.util.List<ConverterFunction>>
typeRules
-
Constructor Summary
Constructors Constructor Description CustomConverterImpl(InternalConverter converter, java.util.Map<java.lang.reflect.Type,java.util.List<ConverterFunction>> rules, java.util.List<ConverterFunction> catchAllRules, java.util.List<ConverterFunction> errHandlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InternalConverting
convert(java.lang.Object obj)
Start a conversion for the given object.Functioning
function()
Start defining a function that can perform given conversions.ConverterBuilder
newConverterBuilder()
Obtain a builder to create a modified converter based on this converter.
-
-
-
Field Detail
-
delegate
private final InternalConverter delegate
-
typeRules
final java.util.Map<java.lang.reflect.Type,java.util.List<ConverterFunction>> typeRules
-
allRules
final java.util.List<ConverterFunction> allRules
-
errorHandlers
final java.util.List<ConverterFunction> errorHandlers
-
-
Constructor Detail
-
CustomConverterImpl
CustomConverterImpl(InternalConverter converter, java.util.Map<java.lang.reflect.Type,java.util.List<ConverterFunction>> rules, java.util.List<ConverterFunction> catchAllRules, java.util.List<ConverterFunction> errHandlers)
-
-
Method Detail
-
convert
public InternalConverting convert(java.lang.Object obj)
Description copied from interface:Converter
Start a conversion for the given object.- Specified by:
convert
in interfaceConverter
- Specified by:
convert
in interfaceInternalConverter
- Parameters:
obj
- The object that should be converted.- Returns:
- A
Converting
object to complete the conversion.
-
function
public Functioning function()
Description copied from interface:Converter
Start defining a function that can perform given conversions.- Specified by:
function
in interfaceConverter
- Returns:
- A
Functioning
object to complete the definition.
-
newConverterBuilder
public ConverterBuilder newConverterBuilder()
Description copied from interface:Converter
Obtain a builder to create a modified converter based on this converter. For more details see theConverterBuilder
interface.- Specified by:
newConverterBuilder
in interfaceConverter
- Returns:
- A new Converter Builder.
-
-