public class AFPResourceManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
includeCached |
| Constructor and Description |
|---|
AFPResourceManager(InternalResourceResolver resourceResolver)
Main constructor
|
| Modifier and Type | Method and Description |
|---|---|
DataStream |
createDataStream(AFPPaintingState paintingState,
java.io.OutputStream outputStream)
Sets the outputstream
|
void |
createIncludedResource(java.lang.String resourceName,
AFPResourceAccessor 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,
AFPResourceAccessor accessor,
byte resourceObjectType,
boolean truetype,
java.lang.String ttc)
Creates an included resource object by loading the contained object from a file.
|
void |
createIncludedResourceFromExternal(java.lang.String resourceName,
java.net.URI uri,
AFPResourceAccessor accessor)
Creates an included resource extracting the named resource from an external source.
|
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.
|
boolean |
includeCachedObject(AFPResourceInfo resourceInfo,
AFPObjectAreaInfo areaInfo) |
boolean |
isObjectCached(AFPResourceInfo resourceInfo)
Returns
true if the passed AFPResourceInfo instance is already cached. |
void |
setDefaultResourceGroupUri(java.net.URI uri)
Sets the default resource group URI.
|
void |
setResourceLevelDefaults(AFPResourceLevelDefaults defaults)
Sets resource level defaults.
|
boolean |
tryIncludeObject(AFPDataObjectInfo dataObjectInfo)
Tries to create an include of a data object that has been previously added to the
AFP data stream.
|
void |
writeToStream()
Tells the streamer to write
|
public AFPResourceManager(InternalResourceResolver resourceResolver)
resourceResolver - the associated InternalResourceResolver instancepublic DataStream createDataStream(AFPPaintingState paintingState, java.io.OutputStream outputStream) throws java.io.IOException
paintingState - the AFP painting stateoutputStream - the outputstreamjava.io.IOException - thrown if an I/O exception of some sort has occurredpublic DataStream getDataStream()
public void writeToStream()
throws java.io.IOException
java.io.IOException - thrown if an I/O exception of some sort has occurred.public void setDefaultResourceGroupUri(java.net.URI uri)
uri - the default resource group URIpublic boolean tryIncludeObject(AFPDataObjectInfo dataObjectInfo) throws java.io.IOException
dataObjectInfo - the data object infojava.io.IOException - thrown if an I/O exception of some sort has occurred.public void createObject(AFPDataObjectInfo dataObjectInfo) throws java.io.IOException
dataObjectInfo - the data object infojava.io.IOException - thrown if an I/O exception of some sort has occurred.public boolean isObjectCached(AFPResourceInfo resourceInfo)
true if the passed AFPResourceInfo instance is already cached.resourceInfo - the resource info to checktrue if the object is cachedpublic boolean includeCachedObject(AFPResourceInfo resourceInfo, AFPObjectAreaInfo areaInfo)
resourceInfo - the resource info to checkareaInfo - the area info to checktrue if ...public void embedFont(AFPFont afpFont, CharacterSet charSet) throws java.io.IOException
afpFont - the AFP font to be checked for embeddingcharSet - the associated character setjava.io.IOException - if there's a problem while embedding the external resourcespublic void createIncludedResource(java.lang.String resourceName,
AFPResourceAccessor accessor,
byte resourceObjectType)
throws java.io.IOException
resourceName - the name of the resourceaccessor - resource accessor to access the resource withresourceObjectType - the resource object type (ResourceObject.*)java.io.IOException - if an I/O error occurs while loading the resourcepublic void createIncludedResource(java.lang.String resourceName,
java.net.URI uri,
AFPResourceAccessor accessor,
byte resourceObjectType,
boolean truetype,
java.lang.String ttc)
throws java.io.IOException
resourceName - the name of the resourceuri - the URI for the resourceaccessor - resource accessor to access the resource withresourceObjectType - the resource object type (ResourceObject.*)java.io.IOException - if an I/O error occurs while loading the resourcepublic void createIncludedResourceFromExternal(java.lang.String resourceName,
java.net.URI uri,
AFPResourceAccessor accessor)
throws java.io.IOException
resourceName - the name of the resourceuri - the URI for the resourceaccessor - resource accessor to access the resource withjava.io.IOException - if an I/O error occurs while loading the resourcepublic void setResourceLevelDefaults(AFPResourceLevelDefaults defaults)
defaults - the new defaultspublic AFPResourceLevelDefaults getResourceLevelDefaults()
Copyright 1999-2022 The Apache Software Foundation. All Rights Reserved.