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 classCustomConverterImpl.ConvertingWrapper
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<ConverterFunction>allRulesprivate InternalConverterdelegate(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 InternalConvertingconvert(java.lang.Object obj)Start a conversion for the given object.Functioningfunction()Start defining a function that can perform given conversions.ConverterBuildernewConverterBuilder()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:ConverterStart a conversion for the given object.- Specified by:
convertin interfaceConverter- Specified by:
convertin interfaceInternalConverter- Parameters:
obj- The object that should be converted.- Returns:
- A
Convertingobject to complete the conversion.
-
function
public Functioning function()
Description copied from interface:ConverterStart defining a function that can perform given conversions.- Specified by:
functionin interfaceConverter- Returns:
- A
Functioningobject to complete the definition.
-
newConverterBuilder
public ConverterBuilder newConverterBuilder()
Description copied from interface:ConverterObtain a builder to create a modified converter based on this converter. For more details see theConverterBuilderinterface.- Specified by:
newConverterBuilderin interfaceConverter- Returns:
- A new Converter Builder.
-
-