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 of
DataHandlerReader.isOptimized() or
the optimize argument of
DataHandlerWriter.writeDataHandler(DataHandler, String, boolean)
or
DataHandlerWriter.writeDataHandler(DataHandlerProvider, String, boolean).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OptimizationPolicyPolicy implementation that optimizes all binary content, regardless of whether is has been marked as eligible for optimization.static final OptimizationPolicyPolicy implementation that optimizes all binary content marked as eligible for optimization. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisOptimized(DataHandler dataHandler, boolean optimize) Determine whether the binary content supplied by a givenDataHandlershould be optimized.booleanisOptimized(DataHandlerProvider dataHandlerProvider, boolean optimize) Determine whether the binary content supplied by a givenDataHandlerProvidershould be optimized.
-
Field Details
-
DEFAULT
Policy implementation that optimizes all binary content marked as eligible for optimization. -
ALL
Policy implementation that optimizes all binary content, regardless of whether is has been marked as eligible for optimization.
-
-
Method Details
-
isOptimized
Determine whether the binary content supplied by a givenDataHandlershould be optimized.- Parameters:
dataHandler- the binary contentoptimize- indicates whether the binary content was initially marked as eligible for optimization (see above)- Returns:
trueif 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
Determine whether the binary content supplied by a givenDataHandlerProvidershould be optimized.- Parameters:
dataHandlerProvider- the binary contentoptimize- indicates whether the binary content was initially marked as eligible for optimization (see above)- Returns:
trueif 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
-