iText 8.0.2 API
iText.Kernel.Utils.Objectpathitems.ObjectPath Class Reference

Class that helps to find two corresponding objects in the compared documents and also keeps track of the already met during comparing process parent indirect objects. More...

Inheritance diagram for iText.Kernel.Utils.Objectpathitems.ObjectPath:
iText.Kernel.Utils.Objectpathitems.TrailerPath

Public Member Functions

  ObjectPath ()
  Creates empty ObjectPath. More...
 
  ObjectPath (iText.Kernel.Utils.Objectpathitems.ObjectPath objectPath)
  Creates an ObjectPath object from another ObjectPath object, passed as argument. More...
 
  ObjectPath (PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
  Creates CompareObjectPath with corresponding base objects in two documents. More...
 
  ObjectPath (PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject, Stack< LocalPathItem > path, Stack< IndirectPathItem > indirects)
 
virtual iText.Kernel.Utils.Objectpathitems.ObjectPath  ResetDirectPath (PdfIndirectReference baseCmpObject, PdfIndirectReference baseOutObject)
  Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base objects of the current instance of the ObjectPath. More...
 
virtual bool  IsComparing (PdfIndirectReference cmpObject, PdfIndirectReference outObject)
  This method is used to define if given objects were already met in the path to the current base objects. More...
 
virtual void  PushArrayItemToPath (int index)
  Adds array item to the direct path. More...
 
virtual void  PushDictItemToPath (PdfName key)
  Adds dictionary item to the direct path. More...
 
virtual void  PushOffsetToPath (int offset)
  Adds offset item to the direct path. More...
 
virtual void  Pop ()
  Removes the last path item from the direct path. More...
 
virtual Stack< LocalPathItem GetLocalPath ()
  Gets local (or direct) path that denotes sequence of the path items from base object to the comparing direct object. More...
 
virtual Stack< IndirectPathItem GetIndirectPath ()
  Gets indirect path which denotes sequence of the indirect references that were passed in comparing process to get to the current base objects. More...
 
virtual PdfIndirectReference  GetBaseCmpObject ()
  Method returns current base iText.Kernel.Pdf.PdfIndirectReference object in the cmp document. More...
 
virtual PdfIndirectReference  GetBaseOutObject ()
  Method returns current base iText.Kernel.Pdf.PdfIndirectReference object in the out document. More...
 
virtual XmlNode  ToXmlNode (XmlDocument document)
  Creates an xml node that describes a direct path stored in this ObjectPath instance. More...
 
override String  ToString ()
  Method returns a string representation of the direct path stored in this ObjectPath instance. More...
 
override int  GetHashCode ()
  Method returns a hash code of this ObjectPath instance. More...
 
override bool  Equals (Object obj)
  Method returns true if this ObjectPath instance equals to the passed object. More...
 

Detailed Description

Class that helps to find two corresponding objects in the compared documents and also keeps track of the already met during comparing process parent indirect objects.

Class that helps to find two corresponding objects in the compared documents and also keeps track of the already met during comparing process parent indirect objects.

You could say that CompareObjectPath instance consists of two parts: direct path and indirect path. Direct path defines path to the currently comparing objects in relation to base objects. It could be empty, which would mean that currently comparing objects are base objects themselves. Base objects are the two indirect objects from the comparing documents which are in the same position in the pdf trees. Another part, indirect path, defines which indirect objects were met during comparison process to get to the current base objects. Indirect path is needed to avoid infinite loops during comparison.

Constructor & Destructor Documentation

◆ ObjectPath() [1/3]

iText.Kernel.Utils.Objectpathitems.ObjectPath.ObjectPath ( )
inline

Creates empty ObjectPath.

◆ ObjectPath() [2/3]

iText.Kernel.Utils.Objectpathitems.ObjectPath.ObjectPath ( iText.Kernel.Utils.Objectpathitems.ObjectPath  objectPath )
inline

Creates an ObjectPath object from another ObjectPath object, passed as argument.

Parameters
objectPath an ObjectPath object to create from.

◆ ObjectPath() [3/3]

iText.Kernel.Utils.Objectpathitems.ObjectPath.ObjectPath ( PdfIndirectReference  baseCmpObject,
PdfIndirectReference  baseOutObject 
)
inline

Creates CompareObjectPath with corresponding base objects in two documents.

Parameters
baseCmpObject base object in cmp document.
baseOutObject base object in out document.

Member Function Documentation

◆ Equals()

override bool iText.Kernel.Utils.Objectpathitems.ObjectPath.Equals ( Object  obj )
inline

Method returns true if this ObjectPath instance equals to the passed object.

Returns
true - if this ObjectPath instance equals to the passed object.

◆ GetBaseCmpObject()

virtual PdfIndirectReference iText.Kernel.Utils.Objectpathitems.ObjectPath.GetBaseCmpObject ( )
inlinevirtual

Method returns current base iText.Kernel.Pdf.PdfIndirectReference object in the cmp document.

Returns
current base iText.Kernel.Pdf.PdfIndirectReference object in the cmp document.

◆ GetBaseOutObject()

virtual PdfIndirectReference iText.Kernel.Utils.Objectpathitems.ObjectPath.GetBaseOutObject ( )
inlinevirtual

Method returns current base iText.Kernel.Pdf.PdfIndirectReference object in the out document.

Returns
current base object in the out document.

◆ GetHashCode()

override int iText.Kernel.Utils.Objectpathitems.ObjectPath.GetHashCode ( )
inline

Method returns a hash code of this ObjectPath instance.

Returns
a int hash code of this ObjectPath instance.

◆ GetIndirectPath()

virtual Stack<IndirectPathItem> iText.Kernel.Utils.Objectpathitems.ObjectPath.GetIndirectPath ( )
inlinevirtual

Gets indirect path which denotes sequence of the indirect references that were passed in comparing process to get to the current base objects.

Returns
indirect path to the current base objects.

◆ GetLocalPath()

virtual Stack<LocalPathItem> iText.Kernel.Utils.Objectpathitems.ObjectPath.GetLocalPath ( )
inlinevirtual

Gets local (or direct) path that denotes sequence of the path items from base object to the comparing direct object.

Returns
direct path to the comparing object.

◆ IsComparing()

virtual bool iText.Kernel.Utils.Objectpathitems.ObjectPath.IsComparing ( PdfIndirectReference  cmpObject,
PdfIndirectReference  outObject 
)
inlinevirtual

This method is used to define if given objects were already met in the path to the current base objects.

This method is used to define if given objects were already met in the path to the current base objects. If this method returns true it basically means that we found a loop in the objects structure and that we already compared these objects.

Parameters
cmpObject cmp object to check if it was already met in base objects path.
outObject out object to check if it was already met in base objects path.
Returns
true if given objects are contained in the path and therefore were already compared.

◆ Pop()

virtual void iText.Kernel.Utils.Objectpathitems.ObjectPath.Pop ( )
inlinevirtual

Removes the last path item from the direct path.

◆ PushArrayItemToPath()

virtual void iText.Kernel.Utils.Objectpathitems.ObjectPath.PushArrayItemToPath ( int  index )
inlinevirtual

Adds array item to the direct path.

Adds array item to the direct path. See ArrayPathItem.

Parameters
index index in the array of the direct object to be compared.

◆ PushDictItemToPath()

virtual void iText.Kernel.Utils.Objectpathitems.ObjectPath.PushDictItemToPath ( PdfName  key )
inlinevirtual

Adds dictionary item to the direct path.

Adds dictionary item to the direct path. See DictPathItem.

Parameters
key key in the dictionary to which corresponds direct object to be compared.

◆ PushOffsetToPath()

virtual void iText.Kernel.Utils.Objectpathitems.ObjectPath.PushOffsetToPath ( int  offset )
inlinevirtual

Adds offset item to the direct path.

Adds offset item to the direct path. See OffsetPathItem.

Parameters
offset offset to the specific byte in the stream that is compared.

◆ ResetDirectPath()

virtual iText.Kernel.Utils.Objectpathitems.ObjectPath iText.Kernel.Utils.Objectpathitems.ObjectPath.ResetDirectPath ( PdfIndirectReference  baseCmpObject,
PdfIndirectReference  baseOutObject 
)
inlinevirtual

Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base objects of the current instance of the ObjectPath.

Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base objects of the current instance of the ObjectPath. This method is used to avoid infinite loop in case of circular references in pdf documents objects structure.

Basically, this method creates copy of the current CompareObjectPath instance, but resets information of the direct paths, and also adds current CompareObjectPath instance base objects to the indirect references chain that denotes a path to the new base objects.

Parameters
baseCmpObject new base object in cmp document.
baseOutObject new base object in out document.
Returns
new ObjectPath instance, which stores chain of the indirect references which were already met to get to the new base objects.

◆ ToString()

override String iText.Kernel.Utils.Objectpathitems.ObjectPath.ToString ( )
inline

Method returns a string representation of the direct path stored in this ObjectPath instance.

Returns
a string representation of the direct path.

◆ ToXmlNode()

virtual XmlNode iText.Kernel.Utils.Objectpathitems.ObjectPath.ToXmlNode ( XmlDocument  document )
inlinevirtual

Creates an xml node that describes a direct path stored in this ObjectPath instance.

Parameters
document xml document, to which this xml node will be added.
Returns
an xml node describing direct path.

Reimplemented in iText.Kernel.Utils.Objectpathitems.TrailerPath.