intarsys PDF library API

de.intarsys.pdf.cos
Class COSDocumentElement

java.lang.Object
  extended by de.intarsys.pdf.cos.COSDocumentElement
All Implemented Interfaces:
ICOSExceptionHandler
Direct Known Subclasses:
COSIndirectObject, COSObject

public abstract class COSDocumentElement
extends Object
implements ICOSExceptionHandler

This is a cos level representation of the elements that may be contained in a cos container. An element may be either a COSObject or a COSIndirectObject to a COSObject. A COSIndirectObject is never seen by an application level programmer, this is an internal construct only.


Method Summary
abstract  Object accept(ICOSObjectVisitor visitor)
          Accept a visitor object.
abstract  COSDocumentElement containable()
          The COSDocumentElement suitable for use in an ICOSContainer.
abstract  COSObject dereference()
          Return the real object.
abstract  COSDocument getDoc()
          The document where this is contained or null.
 void handleException(COSRuntimeException ex)
          Handle ex, optionally rethrow.
 boolean isReference()
          Answer true if this element is a reference (a COSIndirectObject.
 boolean isSwapped()
          Answer true if this elements content is swapped to a persistent store.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isReference

public boolean isReference()
Answer true if this element is a reference (a COSIndirectObject.

Returns:
Answer true if this element is a reference.

isSwapped

public boolean isSwapped()
Answer true if this elements content is swapped to a persistent store.

Returns:
Answer true if this elements content is swapped to a persistent store.

dereference

public abstract COSObject dereference()
Return the real object. This is either the object itself or the object referenced by a reference object (COSIndirectObject).

Returns:
The real object.

accept

public abstract Object accept(ICOSObjectVisitor visitor)
                       throws COSVisitorException
Accept a visitor object. The receiver selects the correct implementation in the visitor by "double dispatching".

Parameters:
visitor - The object visiting the receiver.
Returns:
Object An object depending on the visitor semantics.
Throws:
COSVisitorException - An exception depending on the visitor semantics.

getDoc

public abstract COSDocument getDoc()
The document where this is contained or null. A COSDocumentElement is at most contained in a single COSDocument.

Returns:
The document where this is contained.

containable

public abstract COSDocumentElement containable()
The COSDocumentElement suitable for use in an ICOSContainer. This may be a COSIndirectObject or the COSObject itself if not indirect.

This method should not be used by the application programmer. This is called in the COSObject lifecycle to ensure internal consistency.


handleException

public void handleException(COSRuntimeException ex)
                     throws COSRuntimeException
Description copied from interface: ICOSExceptionHandler
Handle ex, optionally rethrow.

Specified by:
handleException in interface ICOSExceptionHandler
Parameters:
ex - The exceptioin to be handeled.
Throws:
COSRuntimeException

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.