Class ConverterRegistry
- java.lang.Object
-
- net.sourceforge.jeuclid.converter.ConverterRegistry
-
public final class ConverterRegistry extends java.lang.ObjectA registry for image converters.- Version:
- $Revision: 5a7becda9147 $
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConverterRegistry()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Set<java.lang.String>getAvailableExtensions()Retrieve a list of all available extensions.java.util.Set<java.lang.String>getAvailableOutfileTypes()Retrieve a list of available mime types for conversion.ConverterPlugingetConverter(java.lang.String mimeType)Retrieve the converter for a given mime-type.static ConverterRegistrygetInstance()Retrieve the default registry instance.java.lang.StringgetMimeTypeForSuffix(java.lang.String suffix)Returns the MimeType for a given suffix.static ConverterRegistrygetRegisty()Deprecated.usegetInstance()instead.java.lang.StringgetSuffixForMimeType(java.lang.String mimeType)Returns the file suffix suitable for the given mime type.voidregisterConverter(java.lang.String mimeType, ConverterPlugin converter, boolean primary)Registers a converter for the given mime type.voidregisterMimeTypeAndSuffix(java.lang.String mimeType, java.lang.String suffix, boolean primary)Registers a new MimeType and it's suffix.
-
-
-
Method Detail
-
getInstance
public static ConverterRegistry getInstance()
Retrieve the default registry instance.- Returns:
- the ConverterRegistry.
-
getRegisty
@Deprecated public static ConverterRegistry getRegisty()
Deprecated.usegetInstance()instead.usegetInstance()instead.- Returns:
- see
getInstance()
-
getAvailableOutfileTypes
public java.util.Set<java.lang.String> getAvailableOutfileTypes()
Retrieve a list of available mime types for conversion.- Returns:
- a Set<String> containing all valid mime-types.
-
getAvailableExtensions
public java.util.Set<java.lang.String> getAvailableExtensions()
Retrieve a list of all available extensions.- Returns:
- a list of available extensions.
-
getSuffixForMimeType
public java.lang.String getSuffixForMimeType(java.lang.String mimeType)
Returns the file suffix suitable for the given mime type.This function is not fully implemented yet
- Parameters:
mimeType- a mimetype, as returned bygetAvailableOutfileTypes(), or null if unknown.- Returns:
- the three letter suffix common for this type.
-
getMimeTypeForSuffix
public java.lang.String getMimeTypeForSuffix(java.lang.String suffix)
Returns the MimeType for a given suffix.- Parameters:
suffix- the suffix, e.g. png, or null if unknown.- Returns:
- the mime-type
-
registerMimeTypeAndSuffix
public void registerMimeTypeAndSuffix(java.lang.String mimeType, java.lang.String suffix, boolean primary)Registers a new MimeType and it's suffix.- Parameters:
mimeType- the Mime-Typesuffix- The Suffixprimary- If true, old mappings will be overwritten. If false and a mapping already exists, it will stay the same.
-
registerConverter
public void registerConverter(java.lang.String mimeType, ConverterPlugin converter, boolean primary)Registers a converter for the given mime type.- Parameters:
mimeType- The mime type.converter- The converter to register.primary- Converter for this type. If true, old mappings will be overwritten. If false and a mapping already exists, it will stay the same.
-
getConverter
public ConverterPlugin getConverter(java.lang.String mimeType)
Retrieve the converter for a given mime-type.- Parameters:
mimeType- the Mime-Type.- Returns:
- a Converter instance
-
-