fop 1.0

org.apache.fop.afp
Class AFPResourceManager

java.lang.Object
  extended by org.apache.fop.afp.AFPResourceManager

public class AFPResourceManager
extends java.lang.Object

Manages the creation and storage of document resources


Constructor Summary
AFPResourceManager()
          Main constructor
 
Method Summary
 DataStream createDataStream(AFPPaintingState paintingState, java.io.OutputStream outputStream)
          Sets the outputstream
 void createIncludedResource(java.lang.String resourceName, ResourceAccessor accessor, byte resourceObjectType)
          Creates an included resource object by loading the contained object from a file.
 void createIncludedResource(java.lang.String resourceName, java.net.URI uri, ResourceAccessor accessor, byte resourceObjectType)
          Creates an included resource object by loading the contained object from a file.
 void createObject(AFPDataObjectInfo dataObjectInfo)
          Creates a new data object in the AFP datastream
 void embedFont(AFPFont afpFont, CharacterSet charSet)
          Handles font embedding.
 DataStream getDataStream()
          Returns the AFP DataStream
 AFPResourceLevelDefaults getResourceLevelDefaults()
          Returns the resource level defaults in use with this resource manager.
 void setDefaultResourceGroupFilePath(java.lang.String filePath)
          Sets the default resource group file path
 void setResourceLevelDefaults(AFPResourceLevelDefaults defaults)
          Sets resource level defaults.
 void writeToStream()
          Tells the streamer to write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AFPResourceManager

public AFPResourceManager()
Main constructor

Method Detail

createDataStream

public DataStream createDataStream(AFPPaintingState paintingState,
                                   java.io.OutputStream outputStream)
                            throws java.io.IOException
Sets the outputstream

Parameters:
paintingState - the AFP painting state
outputStream - the outputstream
Returns:
a new AFP DataStream
Throws:
java.io.IOException - thrown if an I/O exception of some sort has occurred

getDataStream

public DataStream getDataStream()
Returns the AFP DataStream

Returns:
the AFP DataStream

writeToStream

public void writeToStream()
                   throws java.io.IOException
Tells the streamer to write

Throws:
java.io.IOException - thrown if an I/O exception of some sort has occurred.

setDefaultResourceGroupFilePath

public void setDefaultResourceGroupFilePath(java.lang.String filePath)
Sets the default resource group file path

Parameters:
filePath - the default resource group file path

createObject

public void createObject(AFPDataObjectInfo dataObjectInfo)
                  throws java.io.IOException
Creates a new data object in the AFP datastream

Parameters:
dataObjectInfo - the data object info
Throws:
java.io.IOException - thrown if an I/O exception of some sort has occurred.

embedFont

public void embedFont(AFPFont afpFont,
                      CharacterSet charSet)
               throws java.io.IOException
Handles font embedding. If a font is embeddable and has not already been embedded it will be.

Parameters:
afpFont - the AFP font to be checked for embedding
charSet - the associated character set
Throws:
java.io.IOException - if there's a problem while embedding the external resources

createIncludedResource

public void createIncludedResource(java.lang.String resourceName,
                                   ResourceAccessor accessor,
                                   byte resourceObjectType)
                            throws java.io.IOException
Creates an included resource object by loading the contained object from a file.

Parameters:
resourceName - the name of the resource
accessor - resource accessor to access the resource with
resourceObjectType - the resource object type (ResourceObject.*)
Throws:
java.io.IOException - if an I/O error occurs while loading the resource

createIncludedResource

public void createIncludedResource(java.lang.String resourceName,
                                   java.net.URI uri,
                                   ResourceAccessor accessor,
                                   byte resourceObjectType)
                            throws java.io.IOException
Creates an included resource object by loading the contained object from a file.

Parameters:
resourceName - the name of the resource
uri - the URI for the resource
accessor - resource accessor to access the resource with
resourceObjectType - the resource object type (ResourceObject.*)
Throws:
java.io.IOException - if an I/O error occurs while loading the resource

setResourceLevelDefaults

public void setResourceLevelDefaults(AFPResourceLevelDefaults defaults)
Sets resource level defaults. The existing defaults over merged with the ones passed in as parameter.

Parameters:
defaults - the new defaults

getResourceLevelDefaults

public AFPResourceLevelDefaults getResourceLevelDefaults()
Returns the resource level defaults in use with this resource manager.

Returns:
the resource level defaults

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.