Package org.apache.axiom.util.stax.xop
Interface OptimizationPolicy
-
public interface OptimizationPolicy
Encapsulates an algorithm that decides whether base64 encoded binary data should be optimized using XOP. The implementation takes the decision based on the submitted binary content and the "eligible for optimization" flag. Depending on the context of use, this flag is provided by the return value ofDataHandlerReader.isOptimized()
or theoptimize
argument ofDataHandlerWriter.writeDataHandler(DataHandler, String, boolean)
orDataHandlerWriter.writeDataHandler(DataHandlerProvider, String, boolean)
.
-
-
Field Summary
Fields Modifier and Type Field Description static OptimizationPolicy
ALL
Policy implementation that optimizes all binary content, regardless of whether is has been marked as eligible for optimization.static OptimizationPolicy
DEFAULT
Policy implementation that optimizes all binary content marked as eligible for optimization.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isOptimized(DataHandler dataHandler, boolean optimize)
Determine whether the binary content supplied by a givenDataHandler
should be optimized.boolean
isOptimized(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider, boolean optimize)
Determine whether the binary content supplied by a givenDataHandlerProvider
should be optimized.
-
-
-
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 givenDataHandler
should be optimized.- Parameters:
dataHandler
- the binary contentoptimize
- 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 usingxop:Include
- Throws:
IOException
- if an error occurs while reading the data handler
-
isOptimized
boolean isOptimized(org.apache.axiom.ext.stax.datahandler.DataHandlerProvider dataHandlerProvider, boolean optimize) throws IOException
Determine whether the binary content supplied by a givenDataHandlerProvider
should be optimized.- Parameters:
dataHandlerProvider
- the binary contentoptimize
- 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 usingxop:Include
- Throws:
IOException
- if an error occurs while reading the data handler
-
-