public abstract class AbstractConverter<I,O> extends AbstractHandlerPlugin<ConversionRequest> implements Converter<I,O>
Converter plugins. Performs appropriate
dispatching of Converter.canConvert(ConversionRequest) and
Converter.convert(ConversionRequest) calls based on the actual state of the
given ConversionRequest.| Constructor and Description |
|---|
AbstractConverter() |
| Modifier and Type | Method and Description |
|---|---|
void |
populateInputCandidates(Collection<Object> objects)
Populates the given collection with objects which are known to exist, and
which are usable as inputs for this converter.
|
boolean |
supports(ConversionRequest request)
Gets whether this object is compatible with the given data object.
|
getInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanConvert, canConvert, canConvert, canConvert, canConvert, convert, convert, convert, getInputType, getOutputType, getTypegetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersionpublic void populateInputCandidates(Collection<Object> objects)
Converter
That is: each such object added to the collection would return true
if queried with converter.canConvert(object), and hence would
produce an output of type Converter.getOutputType() if passed to
converter.convert(object).
The means by which "known objects" are determined is implementation
dependent, although the most typical use case is to query the
ObjectService for known objects of type Converter.getInputType(),
and return those. But other behaviors are possible, depending on the
converter implementation.
populateInputCandidates in interface Converter<I,O>objects - an initialized collection into which appropriate objects
will be inserted.public boolean supports(ConversionRequest request)
Typed
By default, this method will return true iff the data is assignable
to the associated type given by Typed.getType(). But individual
implementations may have other requirements beyond class assignability.
supports in interface Converter<I,O>supports in interface Typed<ConversionRequest>supports in class AbstractTypedPlugin<ConversionRequest>Copyright © 2009–2025 SciJava. All rights reserved.