public class AFPResourceManager extends 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,
OutputStream outputStream)
Sets the outputstream
|
void |
createIncludedResource(String resourceName,
AFPResourceAccessor accessor,
byte resourceObjectType)
Creates an included resource object by loading the contained object from a file.
|
void |
createIncludedResource(String resourceName,
URI uri,
AFPResourceAccessor accessor,
byte resourceObjectType,
boolean truetype,
String ttc)
Creates an included resource object by loading the contained object from a file.
|
void |
createIncludedResourceFromExternal(String resourceName,
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(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, OutputStream outputStream) throws IOException
paintingState
- the AFP painting stateoutputStream
- the outputstreamIOException
- thrown if an I/O exception of some sort has occurredpublic DataStream getDataStream()
public void writeToStream() throws IOException
IOException
- thrown if an I/O exception of some sort has occurred.public void setDefaultResourceGroupUri(URI uri)
uri
- the default resource group URIpublic boolean tryIncludeObject(AFPDataObjectInfo dataObjectInfo) throws IOException
dataObjectInfo
- the data object infoIOException
- thrown if an I/O exception of some sort has occurred.public void createObject(AFPDataObjectInfo dataObjectInfo) throws IOException
dataObjectInfo
- the data object infoIOException
- 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 IOException
afpFont
- the AFP font to be checked for embeddingcharSet
- the associated character setIOException
- if there's a problem while embedding the external resourcespublic void createIncludedResource(String resourceName, AFPResourceAccessor accessor, byte resourceObjectType) throws IOException
resourceName
- the name of the resourceaccessor
- resource accessor to access the resource withresourceObjectType
- the resource object type (ResourceObject
.*)IOException
- if an I/O error occurs while loading the resourcepublic void createIncludedResource(String resourceName, URI uri, AFPResourceAccessor accessor, byte resourceObjectType, boolean truetype, String ttc) throws IOException
resourceName
- the name of the resourceuri
- the URI for the resourceaccessor
- resource accessor to access the resource withresourceObjectType
- the resource object type (ResourceObject
.*)IOException
- if an I/O error occurs while loading the resourcepublic void createIncludedResourceFromExternal(String resourceName, URI uri, AFPResourceAccessor accessor) throws IOException
resourceName
- the name of the resourceuri
- the URI for the resourceaccessor
- resource accessor to access the resource withIOException
- if an I/O error occurs while loading the resourcepublic void setResourceLevelDefaults(AFPResourceLevelDefaults defaults)
defaults
- the new defaultspublic AFPResourceLevelDefaults getResourceLevelDefaults()
Copyright © 2022 Apache Software Foundation. All rights reserved.