RevisionGroup

Inheritance: java.lang.Object

public class RevisionGroup

Represents a group of sequential Revision objects.

To learn more, visit the Track Changes in a Document documentation article.

Examples:

Shows how to print info about a group of revisions in a document.


 Document doc = new Document(getMyDir() + "Revisions.docx");

 Assert.assertEquals(7, doc.getRevisions().getGroups().getCount());

 for (RevisionGroup group : doc.getRevisions().getGroups()) {
     System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \n\tRevision text: {2}", group.getAuthor(), group.getRevisionType(), group.getText()));
 }
 

Methods

MethodDescription
getAuthor()Gets the author of this revision group.
getRevisionType()Gets the type of revisions included in this group.
getText()Returns inserted/deleted/moved text or description of format change.

getAuthor()

public String getAuthor()

Gets the author of this revision group.

Examples:

Shows how to print info about a group of revisions in a document.


 Document doc = new Document(getMyDir() + "Revisions.docx");

 Assert.assertEquals(7, doc.getRevisions().getGroups().getCount());

 for (RevisionGroup group : doc.getRevisions().getGroups()) {
     System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \n\tRevision text: {2}", group.getAuthor(), group.getRevisionType(), group.getText()));
 }
 

Returns: java.lang.String - The author of this revision group.

getRevisionType()

public int getRevisionType()

Gets the type of revisions included in this group.

Examples:

Shows how to print info about a group of revisions in a document.


 Document doc = new Document(getMyDir() + "Revisions.docx");

 Assert.assertEquals(7, doc.getRevisions().getGroups().getCount());

 for (RevisionGroup group : doc.getRevisions().getGroups()) {
     System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \n\tRevision text: {2}", group.getAuthor(), group.getRevisionType(), group.getText()));
 }
 

Returns: int - The type of revisions included in this group. The returned value is one of RevisionType constants.

getText()

public String getText()

Returns inserted/deleted/moved text or description of format change.

Examples:

Shows how to print info about a group of revisions in a document.


 Document doc = new Document(getMyDir() + "Revisions.docx");

 Assert.assertEquals(7, doc.getRevisions().getGroups().getCount());

 for (RevisionGroup group : doc.getRevisions().getGroups()) {
     System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \n\tRevision text: {2}", group.getAuthor(), group.getRevisionType(), group.getText()));
 }
 

Returns: java.lang.String - Inserted/deleted/moved text or description of format change.