Package org.apache.fop.afp.modca
Class AbstractResourceGroupContainer
java.lang.Object
org.apache.fop.afp.modca.AbstractAFPObject
org.apache.fop.afp.modca.AbstractStructuredObject
org.apache.fop.afp.modca.AbstractTripletStructuredObject
org.apache.fop.afp.modca.AbstractNamedAFPObject
org.apache.fop.afp.modca.AbstractPageObject
org.apache.fop.afp.modca.AbstractResourceGroupContainer
- All Implemented Interfaces:
Completable
,Streamable
- Direct Known Subclasses:
AbstractResourceEnvironmentGroupContainer
,PageObject
An abstract container of resource objects
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject
AbstractAFPObject.Category, AbstractAFPObject.Type
-
Field Summary
Modifier and TypeFieldDescriptionprotected ResourceGroup
the resource group objectprotected boolean
The container started stateFields inherited from class org.apache.fop.afp.modca.AbstractPageObject
activeEnvironmentGroup, complete, factory, invokeMediumMaps, objects, rotation
Fields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
name
Fields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
triplets
Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject
LOG, SF_CLASS, SF_HEADER_LENGTH
-
Constructor Summary
ConstructorDescriptionAbstractResourceGroupContainer
(Factory factory) Default constructorAbstractResourceGroupContainer
(Factory factory, String name) Named constructorAbstractResourceGroupContainer
(Factory factory, String name, int width, int height, int rotation, int widthRes, int heightRes) Construct a new page object for the specified name argument, the page name should be an 8 character identifier. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns true if this object can be writtenprotected int
Return the number of resources in this containerReturns the resource group in this resource group containerprotected boolean
Returns true if this resource group container contains resourcesprotected void
writeObjects
(Collection<AbstractAFPObject> objects, OutputStream os, boolean forceWrite) Writes a collection ofAbstractAFPObject
s to the AFP Datastream.protected void
writeObjects
(Collection objects, OutputStream os) Writes a collection of Streamable to the AFP Datastream.void
DataStream objects must implement the writeToStream() method to write its data to the given OutputStreamMethods inherited from class org.apache.fop.afp.modca.AbstractPageObject
addObject, createFont, createIncludePageSegment, createInvokeMediumMap, createLine, createNoOperation, createTagLogicalElement, createText, endPage, endPresentationObject, getActiveEnvironmentGroup, getHeight, getPresentationTextObject, getRotation, getTagLogicalElements, getWidth, isComplete, setComplete, writeContent
Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject
copySF, getName, getNameBytes, getNameLength, setName, toString
Methods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject
addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTriplets
Methods inherited from class org.apache.fop.afp.modca.AbstractStructuredObject
writeEnd, writeStart
Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject
copySF, truncate, writeChunksToStream
-
Field Details
-
started
protected boolean startedThe container started state -
resourceGroup
the resource group object
-
-
Constructor Details
-
AbstractResourceGroupContainer
Default constructor- Parameters:
factory
- the object factory
-
AbstractResourceGroupContainer
Named constructor- Parameters:
factory
- the object factoryname
- the name of this resource container
-
AbstractResourceGroupContainer
public AbstractResourceGroupContainer(Factory factory, String name, int width, int height, int rotation, int widthRes, int heightRes) Construct a new page object for the specified name argument, the page name should be an 8 character identifier.- Parameters:
factory
- the object factoryname
- the name of the page.width
- the width of the page.height
- the height of the page.rotation
- the rotation of the page.widthRes
- the width resolution of the page.heightRes
- the height resolution of the page.
-
-
Method Details
-
getResourceCount
protected int getResourceCount()Return the number of resources in this container- Returns:
- the number of resources in this container
-
hasResources
protected boolean hasResources()Returns true if this resource group container contains resources- Returns:
- true if this resource group container contains resources
-
getResourceGroup
Returns the resource group in this resource group container- Returns:
- the resource group in this resource group container
-
writeToStream
DataStream objects must implement the writeToStream() method to write its data to the given OutputStream- Specified by:
writeToStream
in interfaceStreamable
- Overrides:
writeToStream
in classAbstractStructuredObject
- Parameters:
os
- the outputsteam stream- Throws:
IOException
- an I/O exception of some sort has occurred.
-
writeObjects
Writes a collection of Streamable to the AFP Datastream.- Overrides:
writeObjects
in classAbstractAFPObject
- Parameters:
objects
- a list of AFPObjectsos
- The stream to write to- Throws:
IOException
- an I/O exception of some sort has occurred.
-
writeObjects
protected void writeObjects(Collection<AbstractAFPObject> objects, OutputStream os, boolean forceWrite) throws IOException Writes a collection ofAbstractAFPObject
s to the AFP Datastream.- Parameters:
objects
- a list of AFPObjectsos
- The stream to write toforceWrite
- true if writing should happen in any case- Throws:
IOException
- an I/O exception of some sort has occurred.
-
canWrite
Returns true if this object can be written- Parameters:
obj
- an AFP object- Returns:
- true if this object can be written
-