Class BaseRenderEngine

  • All Implemented Interfaces:
    RenderEngine
    Direct Known Subclasses:
    ISYSRenderEngine

    public abstract class BaseRenderEngine
    extends java.lang.Object
    implements RenderEngine
    Render engine base implementation which does necessary pre-checks. (null, supported formats, ...)
    • Field Detail

      • DEFAULT_EXTENSION

        public static final java.lang.String DEFAULT_EXTENSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseRenderEngine

        public BaseRenderEngine()
    • Method Detail

      • configure

        public void configure​(java.util.Map<java.lang.String,​java.lang.String> engineProperties)
        Configures the rendering engine with the specified properties.
        Specified by:
        configure in interface RenderEngine
        Parameters:
        engineProperties - Configuration for the Render Engine
        See Also:
        RenderEngine.configure(java.util.Map)
      • parseExtension

        public java.lang.String parseExtension​(java.lang.String filename)
        Parses the extension the filename.
        Parameters:
        filename - filename which should be parsed
        Returns:
        the extension or an empty string if nothing wDummyRenderEngineas found
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Returns:
        configuration properties for the engine
      • safeRender

        public abstract java.util.List<Rendition> safeRender​(InputStreamDescriptor content,
                                                             SourceFormat format,
                                                             Options options)
                                                      throws java.util.concurrent.TimeoutException,
                                                             RenderingException
        Creates the collection of Rendition instances which represent rendered content incl. information.

        Method to be implemented by the specific render engine.
        Parameters:
        content - Content as InputStreamDescriptor which should be rendered incl. filename
        format - SourceFormat determined by the file extension
        options - Options which are describing how to render the content
        Returns:
        the collection of Rendition instances which represent rendered content incl. informations
        Throws:
        FormatNotSupportedException - if the input or output format is not supported
        PreconditionFailedException - if parts of the options are missing
        java.util.concurrent.TimeoutException - if a timeout was specified and it was reached
        RenderingException - if engine is not available or internal initialization failures
      • createInputStreamDescriptor

        protected static InputStreamDescriptor createInputStreamDescriptor​(byte[] content,
                                                                           java.net.URL url)
      • getFileFromUrl

        public static java.lang.String getFileFromUrl​(java.net.URL url)
      • createInputStreamDescriptor

        protected static InputStreamDescriptor createInputStreamDescriptor​(byte[] content,
                                                                           java.lang.String filename)