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 DataStream
private static final String
private URI
Sets the default resource group file pathprivate final Factory
private static final org.apache.commons.logging.Log
Static logging instanceprivate OutputStream
the final outputstreamprivate final Map
<URI, ResourceGroup> A mapping of external resource destinations to resource groupsprivate StreamedResourceGroup
private final InternalResourceResolver
private static final org.apache.xmlgraphics.io.TempResourceURIGenerator
private OutputStream
temporary document outputstreamprivate final URI
-
Constructor Summary
ConstructorsConstructorDescriptionAFPStreamer
(Factory factory, InternalResourceResolver resourceResolver) Main constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 infovoid
Sets the default resource group URI.void
setOutputStream
(OutputStream outputStream) Sets the final outputstreamvoid
DataStream 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:
writeToStream
in interfaceStreamable
- Parameters:
os
- the outputsteam stream- Throws:
IOException
- an I/O exception of some sort has occurred.
-