OpenOffice.org
XMerge API

org.openoffice.xmerge.merger.diff
Class CharacterParser

java.lang.Object
  |
  +--org.openoffice.xmerge.merger.diff.CharacterParser

public class CharacterParser
extends java.lang.Object

This is a parser to return a character array for difference purpose. It will use depth first search to traverse all the characters inside the text Node under a given Node (most likely to be a paragraph Node).

Note: Once the XML Tree is parsed, then the Iterator will be a snap shot of that tree. That means even the tree is modified later, than the cached paragraph Node list will not be updated accordingly. For this reason and for performance reasons this Iterator does not support any operation methods such as insert, remove or replace. The main purpose of this Iterator is to be used with difference, not with merge.


Constructor Summary
CharacterParser(org.w3c.dom.Node node)
          Standard constructor.
 
Method Summary
 char[] getCharArray()
          Returns the character array representation of the text.
 java.util.List getNodeList()
          Returns the Node pointer with the given character position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterParser

public CharacterParser(org.w3c.dom.Node node)
Standard constructor.
Parameters:
node - The initial root Node.
Method Detail

getCharArray

public char[] getCharArray()
Returns the character array representation of the text.
Returns:
The character array representation of the text.

getNodeList

public java.util.List getNodeList()
Returns the Node pointer with the given character position.
Returns:
The Node pointer with the given character position.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org