Interface OptimizationPolicy

    • Field Detail

      • DEFAULT

        static final OptimizationPolicy DEFAULT
        Policy implementation that optimizes all binary content marked as eligible for optimization.
      • ALL

        static final OptimizationPolicy ALL
        Policy implementation that optimizes all binary content, regardless of whether is has been marked as eligible for optimization.
    • Method Detail

      • isOptimized

        boolean isOptimized​(DataHandler dataHandler,
                            boolean optimize)
                     throws IOException
        Determine whether the binary content supplied by a given DataHandler should be optimized.
        Parameters:
        dataHandler - the binary content
        optimize - indicates whether the binary content was initially marked as eligible for optimization (see above)
        Returns:
        true if the binary content should be optimized using XOP, i.e. encoded using xop:Include
        Throws:
        IOException - if an error occurs while reading the data handler
      • isOptimized

        boolean isOptimized​(DataHandlerProvider dataHandlerProvider,
                            boolean optimize)
                     throws IOException
        Determine whether the binary content supplied by a given DataHandlerProvider should be optimized.
        Parameters:
        dataHandlerProvider - the binary content
        optimize - indicates whether the binary content was initially marked as eligible for optimization (see above)
        Returns:
        true if the binary content should be optimized using XOP, i.e. encoded using xop:Include
        Throws:
        IOException - if an error occurs while reading the data handler