intarsys PDF library API

de.intarsys.pdf.pd
Class PDObject

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport
Direct Known Subclasses:
PDAcroFormNode, PDAction, PDAdditionalActions, PDAnnotation, PDAppearance, PDAppearanceCharacteristics, PDApplicationData, PDBorderStyle, PDBuildData, PDBuildProperties, PDColorSpace, PDDestination, PDEmbeddedFile, PDExtGState, PDFileSpecification, PDFont, PDFontDescriptor, PDFunction, PDIconFit, PDOutlineNode, PDOutputIntent, PDPageNode, PDPattern, PDResources, PDShading, PDSignature, PDSignatureReference, PDTransformMethod, PDTransformParams, PDXObject

public abstract class PDObject
extends COSBasedObject

This is the abstract superclass for all complex PD level objects.

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();


Nested Class Summary
static class PDObject.MetaClass
          The meta class implementation
 
Field Summary
static COSName DK_Subtype
           
static COSName DK_Type
           
static PDObject.MetaClass META
          The meta class instance
 
Method Summary
 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()
           
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
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, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

META

public static final PDObject.MetaClass META
The meta class instance


DK_Type

public static final COSName DK_Type

DK_Subtype

public static final COSName DK_Subtype
Method Detail

cosGetFieldDescendant

public COSObject cosGetFieldDescendant(COSName name)
Convenience method to access fields in 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.

Parameters:
name - the field to read
Returns:
the content of the named field in the PD object or one of its descendants - COSNull is the field is not found

cosGetFieldInheritable

public COSObject cosGetFieldInheritable(COSName name)
Convenience method to access fields in 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.

Parameters:
name - the field to read
Returns:
the content of the named field in the PD object or one of its parents - COSNull if the field is not found

cosGetFieldInherited

public COSObject cosGetFieldInherited(COSName name)
Convenience method to access inherited fields in 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.

Parameters:
name - the field to read
Returns:
the content of the named field in one of the receivers parents - COSNull if the field is not found

cosGetSubtype

public final COSName cosGetSubtype()
The /Subtype field of this PDObject or null. This method is not supported on PDObject instances that are not based on a COSDictionary

Returns:
The /Subtype field of this.

cosGetType

public final COSName cosGetType()
The /Type field of this PDObject or null. This method is not supported on PDObject instances that are not based on a COSDictionary

Returns:
The /Type field of this.

cosRemoveFieldInheritable

public COSObject cosRemoveFieldInheritable(COSName name)
Convenience method to access fields in COSDictionary based PDObject instances. This method supports "inheritance" on hierarchical structured PDObject instances. It removes a field in the receiver and all its descendants.

Parameters:
name - the field to remove from the receiver
Returns:
The object previously associated with name in this

cosSetFieldInheritable

public COSObject cosSetFieldInheritable(COSName name,
                                        COSObject cosObj)
Convenience method to access fields in 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.

Parameters:
name - the field to set
cosObj - the object to set in the field
Returns:
The object previously associated with name in this

cosSetSubtype

public final COSName cosSetSubtype(COSName newType)
Set the /Subtype field of this PDObject. This method is not supported on PDObject instances that are not based on a COSDictionary

Returns:
The /Subtype previously associated with this.

cosSetType

public final COSName cosSetType(COSName newType)
Set the /Type field of this PDObject. This method is not supported on PDObject instances that are not based on a COSDictionary

Returns:
The /Type previously associated with this.

getDoc

public PDDocument getDoc()
Try the best in finding the PDDocument for this PDObject.

Returns:
Try the best in finding the PDDocument for this PDObject.

getGenericChildren

public List getGenericChildren()
Get a collection of 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.

Returns:
A collection of PDObject children if the receiver is a node in a hierarchical structure .

getGenericParent

public PDObject getGenericParent()
The parent of the receiver if it is a node in a hierarchical structure (like page nodes or form fields).

A concrete PDObject implementation supporting inheritance should implement this method.

Returns:
The parent of the receiver if it is a node in a hierarchical structure (like page nodes or form fields).

setGenericParent

public 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).

A concrete PDObject implementation supporting inheritance should implement this method.

Parameters:
parent - The new parent object.

toString

public String toString()
Overrides:
toString in class COSBasedObject

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.