Oxygen XML Editor 11.2 Author API

ro.sync.ecss.extensions.api.node
Class AuthorDocumentFragment

java.lang.Object
  extended by ro.sync.ecss.extensions.api.node.AuthorDocumentFragment

public class AuthorDocumentFragment
extends Object

Represents a fragment of an XML document.

For the following XML code fragment:
<chapter>content text content<sect1>text content<sect11>text content</sect11>text</sect1>text<sect2>text content</sect2>text content text content</chapter>
the corresponding document fragment structure can be represented as:


The image represents the content of the fragment and the red markers represent special control characters which are used to point to the start and the end offsets of the fragment containing nodes.


Constructor Summary
AuthorDocumentFragment(Content content, List<AuthorNode> elements, int leftSplits, int righSplits)
          Constructor.
AuthorDocumentFragment(Content content, List<AuthorNode> elements, int leftSplits, int righSplits, List<ChangeMarker> changeMarkers)
          Constructor.
 
Method Summary
 boolean containsSimpleText()
          Check if an author document fragment content contains simple text.
 int getAcceptedLength()
           
 List<ChangeMarker> getChangeMarks()
          Returns the list with the change marks.
 Content getContent()
           
 List<AuthorNode> getContentNodes()
           
 int getLeftSplits()
           
 int getLength()
           
 int getRightSplits()
           
 boolean isEmpty()
           
 void setChangeMarks(List<ChangeMarker> markers)
          Set the list with the change markers.
 void setLeftSplits(int leftSplits)
          Set the number of the elements the fragment splits to the left.
 void setRighSplits(int righSplits)
          Set the number of the elements the fragment splits to the right.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuthorDocumentFragment

public AuthorDocumentFragment(Content content,
                              List<AuthorNode> elements,
                              int leftSplits,
                              int righSplits)
Constructor.

Parameters:
content - The Content holding the fragment's content.
elements - Elements that make up this fragment.
leftSplits - Number of elements it splits to the left.
righSplits - Number of elements it splits to the right.

AuthorDocumentFragment

public AuthorDocumentFragment(Content content,
                              List<AuthorNode> elements,
                              int leftSplits,
                              int righSplits,
                              List<ChangeMarker> changeMarkers)
Constructor.

Parameters:
content - The Content holding the fragment's content.
elements - Elements that make up this fragment.
leftSplits - Number of elements it splits to the left.
righSplits - Number of elements it splits to the right.
changeMarkers - The list of change markers
Method Detail

getContent

public Content getContent()
Returns:
the Content object holding this fragment's content.

getAcceptedLength

public int getAcceptedLength()
Returns:
The number of characters, including sentinels (element start and end markers), present in the fragment. If there are delete change markers, they are treated as accepted

getLength

public int getLength()
Returns:
The number of characters, including sentinels (element start and end markers), present in the fragment.

getContentNodes

public List<AuthorNode> getContentNodes()
Returns:
The nodes that make up this fragment.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getLeftSplits

public int getLeftSplits()
Returns:
Number of nodes the fragment splits to the left.

getRightSplits

public int getRightSplits()
Returns:
Number of nodes the fragment splits to the right.

setLeftSplits

public void setLeftSplits(int leftSplits)
Set the number of the elements the fragment splits to the left.

Parameters:
leftSplits - The left splits count.

setRighSplits

public void setRighSplits(int righSplits)
Set the number of the elements the fragment splits to the right.

Parameters:
righSplits - The right splits count.

getChangeMarks

public List<ChangeMarker> getChangeMarks()
Returns the list with the change marks. If the fragment is created when change tracking is turned OFF and the selection contains Track Changes then the fragment will contain the list of changes which intersected its region, made relative to the fragment content. If the fragment is created when change tracking in turned ON then the fragment will contain the selection with all changes accepted (so the list will be always NULL).

Returns:
Returns list with ChangeMarker.

setChangeMarks

public void setChangeMarks(List<ChangeMarker> markers)
Set the list with the change markers.

Parameters:
markers - The change markers list.

isEmpty

public boolean isEmpty()
Returns:
true If the fragment is empty.

containsSimpleText

public boolean containsSimpleText()
Check if an author document fragment content contains simple text.

Returns:
True if the content of the given author document fragment contains simple text (the whitespaces are ignored).

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.