Class ConverterRegistry


  • public final class ConverterRegistry
    extends java.lang.Object
    A registry for image converters.
    Version:
    $Revision: 5a7becda9147 $
    • Constructor Detail

      • ConverterRegistry

        protected ConverterRegistry()
        Default constructor.
    • Method Detail

      • getInstance

        public static ConverterRegistry getInstance()
        Retrieve the default registry instance.
        Returns:
        the ConverterRegistry.
      • 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 by getAvailableOutfileTypes() , 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-Type
        suffix - The Suffix
        primary - 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