public abstract class PdfObject extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static byte |
ARRAY |
static byte |
BOOLEAN |
static byte |
DICTIONARY |
protected static short |
FLUSHED |
protected static short |
FORBID_RELEASE |
protected static short |
FREE |
static byte |
INDIRECT_REFERENCE |
protected PdfIndirectReference |
indirectReference
If object is flushed the indirect reference is kept here.
|
static byte |
LITERAL |
protected static short |
MODIFIED |
protected static short |
MUST_BE_FLUSHED |
protected static short |
MUST_BE_INDIRECT |
static byte |
NAME |
static byte |
NULL |
static byte |
NUMBER |
protected static short |
ORIGINAL_OBJECT_STREAM |
protected static short |
READ_ONLY |
protected static short |
READING |
static byte |
STREAM |
static byte |
STRING |
Constructor and Description |
---|
PdfObject() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkState(short state)
Checks state of the flag of current object.
|
protected PdfObject |
clearState(short state)
Clear state of the flag of current object.
|
PdfObject |
clone()
Creates clone of the object which belongs to the same document as original object.
|
protected void |
copyContent(PdfObject from, PdfDocument document)
Copies object content from object 'from'.
|
PdfObject |
copyTo(PdfDocument document)
Copies object to a specified document.
|
PdfObject |
copyTo(PdfDocument document, boolean allowDuplicating)
Copies object to a specified document.
|
void |
flush()
Flushes the object to the document.
|
void |
flush(boolean canBeInObjStm)
Flushes the object to the document.
|
PdfIndirectReference |
getIndirectReference()
Gets the indirect reference associated with the object.
|
abstract byte |
getType()
Gets object type.
|
boolean |
isArray()
Checks if this PdfObject is of the type PdfArray .
|
boolean |
isBoolean()
Checks if this PdfObject is of the type PdfBoolean .
|
boolean |
isDictionary()
Checks if this PdfObject is of the type PdfDictionary .
|
boolean |
isFlushed()
Indicates is the object has been flushed or not.
|
boolean |
isIndirect()
Checks if object is indirect.
|
boolean |
isIndirectReference()
Checks if this PdfObject is of the type PdfIndirectReference .
|
boolean |
isLiteral()
Checks if this PdfObject is of the type PdfLiteral .
|
boolean |
isModified()
Indicates is the object has been set as modified or not.
|
boolean |
isName()
Checks if this PdfObject is of the type PdfName .
|
boolean |
isNull()
Checks if this PdfObject is of the type PdfNull .
|
boolean |
isNumber()
Checks if this PdfObject is of the type PdfNumber .
|
boolean |
isStream()
Checks if this PdfObject is of the type PdfStream .
|
boolean |
isString()
Checks if this PdfObject is of the type PdfString .
|
PdfObject |
makeIndirect(PdfDocument document)
Marks object to be saved as indirect.
|
PdfObject |
makeIndirect(PdfDocument document, PdfIndirectReference reference)
Marks object to be saved as indirect.
|
protected abstract PdfObject |
newInstance()
Creates new instance of object.
|
void |
release() |
protected PdfObject |
setIndirectReference(PdfIndirectReference indirectReference) |
PdfObject |
setModified() |
protected PdfObject |
setState(short state)
Sets special states of current object.
|
public static final byte ARRAY
public static final byte BOOLEAN
public static final byte DICTIONARY
public static final byte LITERAL
public static final byte INDIRECT_REFERENCE
public static final byte NAME
public static final byte NULL
public static final byte NUMBER
public static final byte STREAM
public static final byte STRING
protected static final short FLUSHED
protected static final short FREE
protected static final short READING
protected static final short MODIFIED
protected static final short ORIGINAL_OBJECT_STREAM
protected static final short MUST_BE_FLUSHED
protected static final short MUST_BE_INDIRECT
protected static final short FORBID_RELEASE
protected static final short READ_ONLY
protected PdfIndirectReference indirectReference
public abstract byte getType()
public final void flush()
public final void flush(boolean canBeInObjStm)
canBeInObjStm
- indicates whether object can be placed into object stream.
public PdfIndirectReference getIndirectReference()
public boolean isIndirect()
true
doesn't necessarily mean that indirect reference of this object is not null at the moment. Object could be marked as indirect and be transformed to indirect on flushing.
true
if object is indirect or is to be indirect in the resultant document.
public PdfObject makeIndirect(PdfDocument document, PdfIndirectReference reference)
document
- a document the indirect reference will belong to.
public PdfObject makeIndirect(PdfDocument document)
document
- a document the indirect reference will belong to.
public boolean isFlushed()
public boolean isModified()
public PdfObject clone()
public PdfObject copyTo(PdfDocument document)
document
- document to copy object to.
public PdfObject copyTo(PdfDocument document, boolean allowDuplicating)
document
- document to copy object to.
allowDuplicating
- indicates if to allow copy objects which already have been copied. If object is associated with any indirect reference and allowDuplicating is false then already existing reference will be returned instead of copying object. If allowDuplicating is true then object will be copied and new indirect reference will be assigned.
public PdfObject setModified()
public void release()
public boolean isNull()
PdfObject
is of the type PdfNull
.
true
or false
public boolean isBoolean()
PdfObject
is of the type PdfBoolean
.
true
or false
public boolean isNumber()
PdfObject
is of the type PdfNumber
.
true
or false
public boolean isString()
PdfObject
is of the type PdfString
.
true
or false
public boolean isName()
PdfObject
is of the type PdfName
.
true
or false
public boolean isArray()
PdfObject
is of the type PdfArray
.
true
or false
public boolean isDictionary()
PdfObject
is of the type PdfDictionary
.
true
or false
public boolean isStream()
PdfObject
is of the type PdfStream
.
true
or false
public boolean isIndirectReference()
PdfObject
is of the type PdfIndirectReference
.
true
if this is an indirect reference, otherwise false
public boolean isLiteral()
PdfObject
is of the type PdfLiteral
.
true
if this is a literal, otherwise false
protected abstract PdfObject newInstance()
protected PdfObject setIndirectReference(PdfIndirectReference indirectReference)
protected boolean checkState(short state)
state
- special flag to check
protected PdfObject setState(short state)
state
- special flag of current object
protected PdfObject clearState(short state)
state
- special flag state to clear
protected void copyContent(PdfObject from, PdfDocument document)
from
- object to copy content from.
document
- document to copy object to.
Copyright © 1998–2016 iText Group NV. All rights reserved.