Package org.apache.fop.afp
Class AFPStreamer
java.lang.Object
org.apache.fop.afp.AFPStreamer
- All Implemented Interfaces:
Streamable
Manages the streaming of the AFP output
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DataStreamprivate static final Stringprivate URISets the default resource group file pathprivate final Factoryprivate static final org.apache.commons.logging.LogStatic logging instanceprivate OutputStreamthe final outputstreamprivate final Map<URI, ResourceGroup> A mapping of external resource destinations to resource groupsprivate StreamedResourceGroupprivate final InternalResourceResolverprivate static final org.apache.xmlgraphics.io.TempResourceURIGeneratorprivate OutputStreamtemporary document outputstreamprivate final URI -
Constructor Summary
ConstructorsConstructorDescriptionAFPStreamer(Factory factory, InternalResourceResolver resourceResolver) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes off the AFP stream writing the document streamcreateDataStream(AFPPaintingState paintingState) Creates a new DataStreamgetResourceGroup(AFPResourceLevel level) Returns the resource group for a given resource infovoidSets the default resource group URI.voidsetOutputStream(OutputStream outputStream) Sets the final outputstreamvoidDataStream objects must implement the writeToStream() method to write its data to the given OutputStream
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOGStatic logging instance -
DEFAULT_EXTERNAL_RESOURCE_FILENAME
- See Also:
-
TEMP_URI_GENERATOR
private static final org.apache.xmlgraphics.io.TempResourceURIGenerator TEMP_URI_GENERATOR -
factory
-
resourceResolver
-
pathResourceGroupMap
A mapping of external resource destinations to resource groups -
printFileResourceGroup
-
defaultResourceGroupUri
Sets the default resource group file path -
tempUri
-
tempOutputStream
temporary document outputstream -
outputStream
the final outputstream -
dataStream
-
-
Constructor Details
-
AFPStreamer
Main constructor- Parameters:
factory- a factoryresourceResolver- resource resolver
-
-
Method Details
-
createDataStream
Creates a new DataStream- Parameters:
paintingState- the AFP painting state- Returns:
- a new
DataStream - Throws:
IOException- thrown if an I/O exception of some sort has occurred
-
setDefaultResourceGroupUri
Sets the default resource group URI.- Parameters:
uri- the default resource group URI
-
getResourceGroup
Returns the resource group for a given resource info- Parameters:
level- a resource level- Returns:
- a resource group for the given resource info
-
close
Closes off the AFP stream writing the document stream- Throws:
IOException- if an an I/O exception of some sort has occurred
-
setOutputStream
Sets the final outputstream- Parameters:
outputStream- an outputstream
-
writeToStream
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream- Specified by:
writeToStreamin interfaceStreamable- Parameters:
os- the outputsteam stream- Throws:
IOException- an I/O exception of some sort has occurred.
-