Class ChainedConverter
- java.lang.Object
-
- org.nuxeo.ecm.core.convert.extension.ChainedConverter
-
- All Implemented Interfaces:
Converter
public class ChainedConverter extends Object implements Converter
SpecificConverter
implementation that acts as a converters chain.The chain can be:
- a chain of mime-types
- a chain of converter names
This depends on the properties of the descriptor.
- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
steps
protected List<String>
subConverters
protected boolean
subConvertersBased
-
Constructor Summary
Constructors Constructor Description ChainedConverter()
ChainedConverter(List<String> subConverters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlobHolder
convert(BlobHolder blobHolder, Map<String,Serializable> parameters)
Main method to handle the real Conversion Job.protected BlobHolder
convertBasedOnMimeTypes(BlobHolder blobHolder, Map<String,Serializable> parameters)
Tries to find a chain of converters that fits the mime-types chain.protected BlobHolder
convertBasedSubConverters(BlobHolder blobHolder, Map<String,Serializable> parameters)
List<String>
getSteps()
List<String>
getSubConverters()
Returns the sub converters of this chained converter.void
init(ConverterDescriptor descriptor)
Initializes the Converter.boolean
isSubConvertersBased()
Returns true if this chained converter is sub converters based, false otherwise.
-
-
-
Method Detail
-
convert
public BlobHolder convert(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Description copied from interface:Converter
Main method to handle the real Conversion Job.Returned
BlobHolder
must implementCachableBlobHolder
, otherwise result won't be cached.- Specified by:
convert
in interfaceConverter
- Throws:
ConversionException
-
convertBasedSubConverters
protected BlobHolder convertBasedSubConverters(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
- Throws:
ConversionException
-
convertBasedOnMimeTypes
protected BlobHolder convertBasedOnMimeTypes(BlobHolder blobHolder, Map<String,Serializable> parameters) throws ConversionException
Tries to find a chain of converters that fits the mime-types chain.- Throws:
ConversionException
-
init
public void init(ConverterDescriptor descriptor)
Description copied from interface:Converter
Initializes the Converter.This can be used to retrieve some configuration information from the XMap Descriptor.
-
getSubConverters
public List<String> getSubConverters()
Returns the sub converters of this chained converter.- Since:
- 5.9.2
-
isSubConvertersBased
public boolean isSubConvertersBased()
Returns true if this chained converter is sub converters based, false otherwise.- Since:
- 5.9.4
-
-