public abstract class PdfObjectWrapperPdfObject> extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
protected |
PdfObjectWrapper(T pdfObject) |
Modifier and Type | Method and Description |
---|---|
protected static void |
ensureObjectIsAddedToDocument(PdfObject object)
Some wrappers use object's indirect reference to obtain the PdfDocument to which the object belongs to.
|
protected void |
ensureUnderlyingObjectHasIndirectReference() |
void |
flush() |
T |
getPdfObject() |
boolean |
isFlushed() |
protected abstract boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
PdfObjectWrapper<T> |
makeIndirect(PdfDocument document)
Marks object behind wrapper to be saved as indirect.
|
PdfObjectWrapper<T> |
makeIndirect(PdfDocument document, PdfIndirectReference reference)
Marks object behind wrapper to be saved as indirect.
|
protected static void |
markObjectAsIndirect(PdfObject pdfObject) |
protected void |
setForbidRelease() |
PdfObjectWrapper<T> |
setModified() |
protected void |
setPdfObject(T pdfObject) |
protected void |
unsetForbidRelease() |
protected PdfObjectWrapper(T pdfObject)
public T getPdfObject()
public PdfObjectWrapper<T> makeIndirect(PdfDocument document, PdfIndirectReference reference)
document
- a document the indirect reference belongs to.
reference
- a reference which will be assigned for the object behind wrapper.
public PdfObjectWrapper<T> makeIndirect(PdfDocument document)
document
- a document the indirect reference will belong to.
public PdfObjectWrapper<T> setModified()
public void flush()
public boolean isFlushed()
protected abstract boolean isWrappedObjectMustBeIndirect()
protected void setPdfObject(T pdfObject)
protected void setForbidRelease()
protected void unsetForbidRelease()
protected void ensureUnderlyingObjectHasIndirectReference()
protected static void markObjectAsIndirect(PdfObject pdfObject)
protected static void ensureObjectIsAddedToDocument(PdfObject object)
PdfDocument
to which the object belongs to. For this matter, for these wrappers it is implicitly defined that they work with indirect objects only. Commonly these wrappers have two constructors: one with PdfDocument
as parameter to create a new object, and the other one which wraps around the given PdfObject
. This method should be used in the second type of constructors to ensure that wrapper will able to obtain the PdfDocument
instance.
object
- the PdfObject
to be checked if it is indirect.
Copyright © 1998–2023 iText Group NV. All rights reserved.