|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.cos.COSDocumentElement
de.intarsys.pdf.cos.COSObject
de.intarsys.pdf.cos.COSCompositeObject
public abstract class COSCompositeObject
A superclass implementation for all containers of other COSObject
instances.
Field Summary |
---|
Fields inherited from class de.intarsys.pdf.cos.COSObject |
---|
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER |
Method Summary | |
---|---|
void |
addObjectListener(ICOSObjectListener listener)
Add a listener for object changes. |
ICOSContainer |
associate(ICOSContainer newContainer,
COSObject object)
It is the responsibility of the current container to create the association with the new one. |
COSDocumentElement |
containable(COSObject object)
The stand-in to be used when object should be contained in a container. |
COSObject |
copyDeep()
Make a deep copy of the receiver within the same document. |
COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document. |
ICOSContainer |
disassociate(ICOSContainer oldContainer,
COSObject object)
It is the responsibility of the current container to remove the association from the old one. |
Object |
getAttribute(Object key)
get an attribute from the context |
boolean |
isObjectListenerAvailable()
true if an ICOSObjectListener is registered. |
boolean |
isPrimitive()
Answer true if this object is of a primitive type |
int |
referenceCount()
The number of references to the contained object. |
COSIndirectObject |
referenceIndirect(COSObject object)
Change the reference to the object contained in this to an indirect one via reference. |
void |
register(COSDocumentElement object)
It is the responsibility of the active container to register object in its data structures. |
Object |
removeAttribute(Object key)
remove an attribute in the context |
void |
removeObjectListener(ICOSObjectListener listener)
Remove a listener for object changes. |
ICOSContainer |
restoreStateContainer(ICOSContainer pContainer)
Restore the save state for the container. |
ICOSContainer |
saveStateContainer()
Create a save state for the container when saving the COSObject state. |
Object |
setAttribute(Object key,
Object value)
set the value of an attribute in the context |
void |
willChange(COSObject change)
Propagate a change from a COSObject down in the hierarchy. |
Methods inherited from class de.intarsys.pdf.cos.COSObject |
---|
asArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asStream, asString, basicIterator, beConstant, beIndirect, containable, copyOptional, copyShallow, copySubGraph, dereference, getContainer, getDoc, getIndirectObject, isDangling, isIndirect, isNull, isNumber, isSwapped, iterator, restoreState, stringValue, toString |
Methods inherited from class de.intarsys.pdf.cos.COSDocumentElement |
---|
accept, handleException, isReference |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.intarsys.pdf.cos.ICOSContainer |
---|
getDoc |
Methods inherited from interface de.intarsys.tools.component.ISaveStateSupport |
---|
saveState |
Method Detail |
---|
public Object setAttribute(Object key, Object value)
IAttributeSupport
setAttribute
in interface IAttributeSupport
key
- the name of the attribute to setvalue
- the new value the attribute
key
public COSIndirectObject referenceIndirect(COSObject object)
This method must be redefined by all containers to reflect the new reference type in their child references.
This event is delegated to the document to create the correct state for a new indirect object. If a document is not yet present, the state is changed when the COSObject (s) are added to the document finally. This can happen when constructing a COSObject graph "offline" and later add it to the document.
From the COS invariants you can be sure that the object referenced by ref is contained in this at most once
referenceIndirect
in interface ICOSContainer
object
- public void willChange(COSObject change)
ICOSContainer
willChange
in interface ICOSContainer
public boolean isPrimitive()
COSObject
isPrimitive
in class COSObject
public Object getAttribute(Object key)
IAttributeSupport
getAttribute
in interface IAttributeSupport
key
- the name of the attribute to get
public Object removeAttribute(Object key)
IAttributeSupport
removeAttribute
in interface IAttributeSupport
key
- the name of the attribute to remove
key
public void addObjectListener(ICOSObjectListener listener)
COSObject
addObjectListener
in class COSObject
listener
- The listener to be informed about changes.public boolean isObjectListenerAvailable()
COSObject
true
if an ICOSObjectListener
is registered. This
is for test purposes.
isObjectListenerAvailable
in class COSObject
public void removeObjectListener(ICOSObjectListener listener)
COSObject
removeObjectListener
in class COSObject
listener
- The listener to be removed.public ICOSContainer associate(ICOSContainer newContainer, COSObject object)
ICOSContainer
| composite | indirect |
|
constant | n.a. | n.a. | (always copied before by "containable")
null | ok | ok |
composite | error | ok |
indirect | ok | ok |
associate
in interface ICOSContainer
ICOSContainer
for object
public ICOSContainer disassociate(ICOSContainer oldContainer, COSObject object)
ICOSContainer
| composite | indirect | | constant | n.a. | n.a. | null | n.a. | n.a. | composite | ok | n.a. | indirect | ok | n.a. |
disassociate
in interface ICOSContainer
ICOSContainer
for object
public COSDocumentElement containable(COSObject object)
ICOSContainer
containable
in interface ICOSContainer
object
- THe object whose containable is requested.
public final COSObject copyDeep()
COSObject
The algorithm copies this
along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyDeep
in class COSObject
public COSObject copyDeep(Map copied)
COSObject
The copied
map is used to identify objects copied in
earlier runs of this method to avoid duplicating resources used in
different copy targets (for example the pages of a document).
copied
is modified while executing copyDeep
and contains a mapping from indirect objects in the original document to
copied objects.
The algorithm copies this
along with all outgoing
references (recursively).
Object identity is preserved.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyDeep
in class COSObject
COSObject.copyDeep()
public void register(COSDocumentElement object)
ICOSContainer
register
in interface ICOSContainer
object
- The new object to be registered in the hierarchy.public int referenceCount()
ICOSContainer
referenceCount
in interface ICOSContainer
public ICOSContainer saveStateContainer()
ICOSContainer
saveStateContainer
in interface ICOSContainer
public ICOSContainer restoreStateContainer(ICOSContainer pContainer)
ICOSContainer
restoreStateContainer
in interface ICOSContainer
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |