public abstract class PDObject extends COSBasedObject
PD Level objects provide the PDF semantics on top of the basic datatypes of COS Level objects. PDObject provides generic methods used along all subtypes.
PDObjects should be created only using the factory methods of their meta
classes to ensure the semantics implemented in the PD layer, as for example
PD object identity, subclass selection or proper initialization.
Example:
PDPage page = (PDPage)PDPage.META.createNew();
| Modifier and Type | Class and Description |
|---|---|
static class |
PDObject.MetaClass
The meta class implementation
|
| Modifier and Type | Field and Description |
|---|---|
static COSName |
DK_Subtype |
static COSName |
DK_Type |
static PDObject.MetaClass |
META
The meta class instance
|
| Modifier and Type | Method and Description |
|---|---|
COSObject |
cosGetFieldDescendant(COSName name)
Convenience method to access fields in
COSDictionary based
PDObject instances. |
COSObject |
cosGetFieldInheritable(COSName name)
Convenience method to access fields in
COSDictionary based
PDObject instances. |
COSObject |
cosGetFieldInherited(COSName name)
Convenience method to access inherited fields in
COSDictionary
based PDObject instances. |
COSName |
cosGetSubtype()
The /Subtype field of this
PDObject or null. |
COSName |
cosGetType()
The /Type field of this
PDObject or null. |
COSObject |
cosRemoveFieldInheritable(COSName name)
Convenience method to access fields in
COSDictionary based
PDObject instances. |
COSObject |
cosSetFieldInheritable(COSName name,
COSObject cosObj)
Convenience method to access fields in
COSDictionary based
PDObject instances. |
COSName |
cosSetSubtype(COSName newType)
Set the /Subtype field of this
PDObject. |
COSName |
cosSetType(COSName newType)
Set the /Type field of this
PDObject. |
PDDocument |
getDoc()
Try the best in finding the PDDocument for this PDObject.
|
List |
getGenericChildren()
Get a collection of
PDObject children if the receiver is a node
in a hierarchical structure (like page nodes or form fields). |
PDObject |
getGenericParent()
The parent of the receiver if it is a node in a hierarchical structure
(like page nodes or form fields).
|
void |
setGenericParent(PDObject parent)
Set the parent of the receiver if it is a node in a hierarchical
structure (like page nodes or form fields).
|
String |
toString() |
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, invalidateCaches, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldStringpublic static final PDObject.MetaClass META
public static final COSName DK_Type
public static final COSName DK_Subtype
public COSObject cosGetFieldDescendant(COSName name)
COSDictionary based
PDObject instances. This method supports "inheritance" on
hierarchical structured PDObject instances. It returns the field
either from the receiver or one of the known descendants.name - the field to readpublic COSObject cosGetFieldInheritable(COSName name)
COSDictionary based
PDObject instances.
This method supports "inheritance" on hierarchical structured
PDObject instances. It returns the field either from the receiver
or one of its parents.
name - the field to readpublic COSObject cosGetFieldInherited(COSName name)
COSDictionary
based PDObject instances.
This method supports "inheritance" on hierarchical structured
PDObject instances. It returns the inherited field value from one
of the receiver's parents or COSNull.
name - the field to readpublic final COSName cosGetSubtype()
PDObject or null. This method is not
supported on PDObject instances that are not based on a
COSDictionarypublic final COSName cosGetType()
PDObject or null. This method is not
supported on PDObject instances that are not based on a
COSDictionarypublic COSObject cosRemoveFieldInheritable(COSName name)
COSDictionary based
PDObject instances. This method supports "inheritance" on
hierarchical structured PDObject instances. It removes a field in
the receiver and all its descendants.name - the field to remove from the receivername in thispublic COSObject cosSetFieldInheritable(COSName name, COSObject cosObj)
COSDictionary based
PDObject instances. This method supports "inheritance" on
hierarchical structured PDObject instances. It sets a field value
in the receiver when the field is inheritable. This method removes the
field from every child to make sure it uses the inherited value.name - the field to setcosObj - the object to set in the fieldname in thispublic final COSName cosSetSubtype(COSName newType)
PDObject. This method is not
supported on PDObject instances that are not based on a
COSDictionarypublic final COSName cosSetType(COSName newType)
PDObject. This method is not
supported on PDObject instances that are not based on a
COSDictionarypublic PDDocument getDoc()
public List getGenericChildren()
PDObject children if the receiver is a node
in a hierarchical structure (like page nodes or form fields).
This enables the generic implementation of inherited field values and so on.
A concrete PDObject implementation supporting inheritance should implement this method.
PDObject children if the receiver is a
node in a hierarchical structure .public PDObject getGenericParent()
A concrete PDObject implementation supporting inheritance should implement this method.
public void setGenericParent(PDObject parent)
A concrete PDObject implementation supporting inheritance should implement this method.
parent - The new parent object.public String toString()
toString in class COSBasedObjectCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.