PDF Clown
0.1.2

org.pdfclown.objects
Class PdfObject

java.lang.Object
  extended by org.pdfclown.objects.PdfObject
All Implemented Interfaces:
Cloneable, IVisitable
Direct Known Subclasses:
PdfDataObject, PdfIndirectObject

public abstract class PdfObject
extends Object
implements Cloneable, IVisitable

Abstract PDF object.

Version:
0.1.2, 12/28/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Constructor Summary
protected PdfObject()
           
 
Method Summary
protected  Object clone()
          Creates a shallow copy of this object.
 PdfObject clone(File context)
          Creates a deep copy of this object within the specified file context.
static PdfObject clone(PdfObject object, File context)
          Gets the clone of the specified object, registered inside the specified file context.
 PdfIndirectObject getContainer()
          Gets the indirect object containing this object.
 PdfIndirectObject getDataContainer()
          Gets the indirect object containing the data associated to this object.
 File getFile()
          Gets the file containing this object.
 PdfIndirectObject getIndirectObject()
          Gets the indirect object corresponding to this object.
abstract  PdfObject getParent()
          Gets the parent of this object.
 PdfReference getReference()
          Gets the indirect reference of this object.
abstract  boolean isUpdateable()
          Gets whether the detection of object state changes is enabled.
abstract  boolean isUpdated()
          Gets whether the initial state of this object has been modified.
protected abstract  boolean isVirtual()
          Gets whether this object acts like a null-object placeholder.
 PdfDataObject resolve()
          Ensures this object to be resolved into its corresponding data object.
static PdfDataObject resolve(PdfObject object)
          Ensures an indirect reference to be resolved into its corresponding data object.
abstract  void setUpdateable(boolean value)
           
protected abstract  void setUpdated(boolean value)
           
protected abstract  void setVirtual(boolean value)
           
abstract  PdfObject swap(PdfObject other)
          Swaps contents between this object and the other one.
 PdfDirectObject unresolve()
          Ensures this object to be unresolved into its corresponding indirect reference, if available.
static PdfDirectObject unresolve(PdfDataObject object)
          Ensures a data object to be unresolved into its corresponding indirect reference, if available.
protected  void update()
          Updates the state of this object.
abstract  void writeTo(IOutputStream stream, File context)
          Serializes this object to the specified stream.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pdfclown.objects.IVisitable
accept
 

Constructor Detail

PdfObject

protected PdfObject()
Method Detail

clone

public static final PdfObject clone(PdfObject object,
                                    File context)
Gets the clone of the specified object, registered inside the specified file context.

Parameters:
object - Object to clone into the specified file context.
context - File context of the cloning.

resolve

public static PdfDataObject resolve(PdfObject object)
Ensures an indirect reference to be resolved into its corresponding data object.

Parameters:
object - Object to resolve.

unresolve

public static PdfDirectObject unresolve(PdfDataObject object)
Ensures a data object to be unresolved into its corresponding indirect reference, if available.

Parameters:
object - Object to unresolve.
Returns:
PdfReference, if available; object, otherwise.

clone

public PdfObject clone(File context)
Creates a deep copy of this object within the specified file context.


getContainer

public PdfIndirectObject getContainer()
Gets the indirect object containing this object.

See Also:
getDataContainer(), getIndirectObject()

getDataContainer

public PdfIndirectObject getDataContainer()
Gets the indirect object containing the data associated to this object.

See Also:
getContainer(), getIndirectObject()

getFile

public File getFile()
Gets the file containing this object.


getIndirectObject

public PdfIndirectObject getIndirectObject()
Gets the indirect object corresponding to this object.

See Also:
getContainer(), getDataContainer()

getParent

public abstract PdfObject getParent()
Gets the parent of this object.

See Also:
getContainer()

getReference

public PdfReference getReference()
Gets the indirect reference of this object.


isUpdateable

public abstract boolean isUpdateable()
Gets whether the detection of object state changes is enabled.


isUpdated

public abstract boolean isUpdated()
Gets whether the initial state of this object has been modified.


resolve

public PdfDataObject resolve()
Ensures this object to be resolved into its corresponding data object.

See Also:
unresolve()

setUpdateable

public abstract void setUpdateable(boolean value)
See Also:
isUpdateable()

swap

public abstract PdfObject swap(PdfObject other)
Swaps contents between this object and the other one.

Parameters:
other - Object whose contents have to be swapped with this one's.
Returns:
This object.

unresolve

public PdfDirectObject unresolve()
Ensures this object to be unresolved into its corresponding indirect reference, if available.

Returns:
PdfReference, if available; this, otherwise.
See Also:
resolve()

writeTo

public abstract void writeTo(IOutputStream stream,
                             File context)
Serializes this object to the specified stream.

Parameters:
stream - Target stream.
context - File context.

clone

protected final Object clone()
Creates a shallow copy of this object.

Overrides:
clone in class Object

isVirtual

protected abstract boolean isVirtual()
Gets whether this object acts like a null-object placeholder.


setUpdated

protected abstract void setUpdated(boolean value)
See Also:
isUpdated()

setVirtual

protected abstract void setVirtual(boolean value)
See Also:
isVirtual()

update

protected final void update()
Updates the state of this object.


PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.