com.aspose.words

Class RevisionGroupCollection

  • java.lang.Object
    • com.aspose.words.RevisionGroupCollection
  • All Implemented Interfaces:
    java.lang.Iterable
    public class RevisionGroupCollection 
    extends java.lang.Object

A collection of RevisionGroup objects that represent revision groups in the document.

You do not create instances of this class directly. Use the RevisionCollection.Groups property to get revision groups present in a document.

Example:

Shows how to get info about a set of revisions in document.
Document doc = new Document(getMyDir() + "Document.Revisions.docx");

System.out.println(MessageFormat.format("Revision groups count: {0}\n", doc.getRevisions().getGroups().getCount()));

// Get info about all of revisions in document
for (RevisionGroup group : doc.getRevisions().getGroups()) {
    System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \nRevision text: {2}", group.getAuthor(),
            group.getRevisionType(), group.getRevisionType()));
}

Example:

Shows how to get a set of revisions in document.
Document doc = new Document(getMyDir() + "Document.Revisions.docx");

// Get revision group by index.
RevisionGroup revisionGroup = doc.getRevisions().getGroups().get(1);

// Get info about specific revision groups sorted by RevisionType
for (RevisionGroup revision : doc.getRevisions().getGroups()) {
    if (revision.getRevisionType() == RevisionType.INSERTION) {
        System.out.println(MessageFormat.format("Revision type: {0},\nRevision author: {1},\nRevision text: {2}.\n",
                revision.getRevisionType(), revision.getAuthor(), revision.getText()));
    }
}

Property Getters/Setters Summary
intgetCount()
Returns the number of revision groups in the collection.
RevisionGroupget(int index)
Returns a revision group at the specified index.
 
Method Summary
java.util.Iterator<RevisionGroup>iterator()
Returns an enumerator object.
 

    • Property Getters/Setters Detail

      • getCount

        public int getCount()
        
        Returns the number of revision groups in the collection.

        Example:

        Shows how to get info about a set of revisions in document.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        System.out.println(MessageFormat.format("Revision groups count: {0}\n", doc.getRevisions().getGroups().getCount()));
        
        // Get info about all of revisions in document
        for (RevisionGroup group : doc.getRevisions().getGroups()) {
            System.out.println(MessageFormat.format("Revision author: {0}; Revision type: {1} \nRevision text: {2}", group.getAuthor(),
                    group.getRevisionType(), group.getRevisionType()));
        }
      • get

        public RevisionGroup get(int index)
        
        Returns a revision group at the specified index.

        Example:

        Shows how to get a set of revisions in document.
        Document doc = new Document(getMyDir() + "Document.Revisions.docx");
        
        // Get revision group by index.
        RevisionGroup revisionGroup = doc.getRevisions().getGroups().get(1);
        
        // Get info about specific revision groups sorted by RevisionType
        for (RevisionGroup revision : doc.getRevisions().getGroups()) {
            if (revision.getRevisionType() == RevisionType.INSERTION) {
                System.out.println(MessageFormat.format("Revision type: {0},\nRevision author: {1},\nRevision text: {2}.\n",
                        revision.getRevisionType(), revision.getAuthor(), revision.getText()));
            }
        }
    • Method Detail

      • iterator

        public java.util.Iterator<RevisionGroup> iterator()
        Returns an enumerator object.