public abstract class COSObjectProxy extends COSCompositeObject implements Cloneable
You can use this for example to implement an elegant solution for PDF signing, which is defined on the serialized bytes, except some defined byte range. The proxy mechanics allow for creating a placeholder for the signature data, filled in at the correct position later by some post processing.
CONSTANT_CONTAINER, NULL_CONTAINER, SLOT_CONTAINER| Constructor and Description |
|---|
COSObjectProxy()
Create a
COSObjectProxy |
| Modifier and Type | Method and Description |
|---|---|
Object |
accept(ICOSObjectVisitor visitor)
Accept a visitor object.
|
Iterator |
basicIterator()
An iterator over contained objects and references.
|
COSObject |
copyDeep(Map copied)
Make a deep copy of the receiver within the same document.
|
COSObject |
copyShallow()
Make a copy of the receiver.
|
COSObject |
cosGetObject()
The wrapped
COSObject, according to COS level semantics. |
COSObject |
dereference()
return the real object. this is needed for polymorphic handling of
document elements. at application programming level only
COSObject, never COSIndirectObject is seen. |
void |
ended(COSWriter writer)
Attention: The user must handle encryption by himself.
|
int |
getLength()
The length within the data stream for the serialization of this.
|
COSObject |
getObject()
The object represented by the proxy.
|
long |
getPosition()
The position within the data stream for the serialization of this.
|
Iterator<COSObject> |
iterator()
An iterator over contained objects.
|
boolean |
mayBeSwapped()
true if this object may be swapped from memory by the
garbage collector. |
void |
reserveData(int pLength)
Reserve
length bytes for the serialization of this. |
Object |
saveState() |
void |
setPosition(long position)
Assign the position within the data stream.
|
addObjectListener, associate, containable, copyDeep, disassociate, getAttribute, harden, isObjectListenerAvailable, isPrimitive, referenceCount, referenceIndirect, register, removeAttribute, removeObjectListener, restoreStateContainer, saveStateContainer, setAttribute, soften, willChangeasArray, asBoolean, asDictionary, asFixed, asInteger, asName, asNull, asNumber, asStream, asString, beConstant, beIndirect, containable, copyOptional, copySubGraph, getContainer, getDoc, getIndirectObject, getValueBoolean, getValueBytes, getValueFloat, getValueInteger, getValueString, harden, isDangling, isIndirect, isNull, isNumber, isSwapped, restoreState, soften, stringValue, toStringhandleException, isReferenceequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDocpublic COSObjectProxy()
COSObjectProxypublic Object accept(ICOSObjectVisitor visitor) throws COSVisitorException
COSDocumentElementvisitor by "double dispatching".accept in class COSDocumentElementvisitor - The object visiting the receiver.COSVisitorException - An exception depending on the visitor semantics.public Iterator basicIterator()
COSObjectThis iterator returns COSDocumentElements, leaving references alone.
basicIterator in class COSObjectpublic 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 COSCompositeObjectCOSObject.copyDeep()public COSObject copyShallow()
COSObjectA copy is made of the receiver and after this recursively of all not indirect objects.
Be careful when copying objects, as there are semantics that may NOT be recognized by this method.
copyShallow in class COSObjectpublic COSObject cosGetObject()
COSObject, according to COS level semantics. This
method returns never null.COSObject, according to COS level semantics.public COSObject dereference()
COSObjectCOSObject, never COSIndirectObject is seen.dereference in class COSObjectCOSObjectpublic void ended(COSWriter writer) throws IOException
writer - IOExceptionpublic int getLength()
public COSObject getObject()
public long getPosition()
public Iterator<COSObject> iterator()
COSObjectThis iterator returns only COSObject instances, references are dereferenced.
public boolean mayBeSwapped()
COSObjecttrue if this object may be swapped from memory by the
garbage collector.mayBeSwapped in class COSCompositeObjecttrue if this object may be swapped from memory by
the garbage collector.public void reserveData(int pLength)
length bytes for the serialization of this.pLength - Number of bytes to be reserved.public Object saveState()
saveState in interface de.intarsys.tools.component.ISaveStateSupportpublic void setPosition(long position)
position - The position within the data stream.Copyright © 2013 intarsys consulting GmbH. All Rights Reserved.