Package org.scijava.convert
Class AbstractDelegateConverter<I,D,O>
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.plugin.AbstractTypedPlugin<D>
-
- org.scijava.plugin.AbstractHandlerPlugin<ConversionRequest>
-
- org.scijava.convert.AbstractConverter<I,O>
-
- org.scijava.convert.AbstractDelegateConverter<I,D,O>
-
- Type Parameters:
I- the input typeD- the delegate typeO- the output type
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Converter<I,O>,Identifiable,Locatable,Logged,HandlerPlugin<ConversionRequest>,HasPluginInfo,RichPlugin,SciJavaPlugin,SingletonPlugin,TypedPlugin<ConversionRequest>,Prioritized,Typed<ConversionRequest>,Versioned
public abstract class AbstractDelegateConverter<I,D,O> extends AbstractConverter<I,O>
Abstract superclass forConverterplugins that delegate to other converters to chain two conversion steps together.- Author:
- Jan Eglinger
-
-
Constructor Summary
Constructors Constructor Description AbstractDelegateConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> Tconvert(Object src, Class<T> dest)Converts the given object to an object of the specified type.protected abstract Class<D>getDelegateType()-
Methods inherited from class org.scijava.convert.AbstractConverter
populateInputCandidates, supports
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.convert.Converter
canConvert, canConvert, canConvert, canConvert, canConvert, convert, convert, getInputType, getOutputType, getType
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
convert
public <T> T convert(Object src, Class<T> dest)
Description copied from interface:ConverterConverts the given object to an object of the specified type. The object is casted directly if possible, or else a new object is created using the destination type's public constructor that takes the original object as input (except when converting toString, which uses theObject.toString()method instead). In the case of primitive types, returns an object of the corresponding wrapped type. If the destination type does not have an appropriate constructor, returns null.- Type Parameters:
T- Type to which the object should be converted.- Parameters:
src- The object to convert.dest- Type to which the object should be converted.
-
-