ApplyRevisionOptions
Inheritance: java.lang.Object
public class ApplyRevisionOptions
The ApplyRevisionOptions class allows you to update the state of revisions before they are applied to the final document.
It provides various constructors and properties to customize the revision application process.
Example usage:
try (RevisionHandler revisionHandler = new RevisionHandler(sourceFile)) {
List revisionList = revisionHandler.getRevisions();
for (RevisionInfo revisionInfo : revisionList) {
if (revisionInfo.getType() == RevisionType.DELETION)
// Set an action to be applied to the revision
revisionInfo.setAction(RevisionAction.Accept);
}
// Create an instance of ApplyRevisionOptions
ApplyRevisionOptions revisionChanges = new ApplyRevisionOptions();
revisionChanges.setChanges(revisionList);
// Apply the revisions using the options
revisionHandler.applyRevisionChanges(resultFile, revisionChanges);
}
Constructors
Constructor | Description |
---|---|
ApplyRevisionOptions() | Initializes a new instance of the ApplyRevisionOptions class. |
ApplyRevisionOptions(List |
Instantiates a new ApplyRevisionOptions object with the specified list of revisions. |
ApplyRevisionOptions(List |
Instantiates a new ApplyRevisionOptions object with the specified list of revisions and a common revision action. |
ApplyRevisionOptions(RevisionAction revisionAction) | Instantiates a new ApplyRevisionOptions object with a common revision action. |
Methods
Method | Description |
---|---|
getChanges() | Gets the list of revisions to be applied. |
setChanges(List |
Sets the list of revisions to be applied. |
getCommonHandler() | Gets the common revision action to be applied to all revisions. |
setCommonHandler(RevisionAction commonHandler) | Sets the common revision action to be applied to all revisions. |
ApplyRevisionOptions()
public ApplyRevisionOptions()
Initializes a new instance of the ApplyRevisionOptions class.
ApplyRevisionOptions(List changes)
public ApplyRevisionOptions(List<RevisionInfo> changes)
Instantiates a new ApplyRevisionOptions object with the specified list of revisions.
Parameters:
Parameter | Type | Description |
---|---|---|
changes | java.util.List<com.groupdocs.comparison.words.revision.RevisionInfo> | The list of revisions to be applied |
ApplyRevisionOptions(List changes, RevisionAction revisionAction)
public ApplyRevisionOptions(List<RevisionInfo> changes, RevisionAction revisionAction)
Instantiates a new ApplyRevisionOptions object with the specified list of revisions and a common revision action.
Parameters:
Parameter | Type | Description |
---|---|---|
changes | java.util.List<com.groupdocs.comparison.words.revision.RevisionInfo> | The list of revisions to be applied |
revisionAction | RevisionAction | The common revision action to be applied to all revisions |
ApplyRevisionOptions(RevisionAction revisionAction)
public ApplyRevisionOptions(RevisionAction revisionAction)
Instantiates a new ApplyRevisionOptions object with a common revision action.
Parameters:
Parameter | Type | Description |
---|---|---|
revisionAction | RevisionAction | The common revision action to be applied to all revisions |
getChanges()
public List<RevisionInfo> getChanges()
Gets the list of revisions to be applied.
Returns: java.util.List<com.groupdocs.comparison.words.revision.RevisionInfo> - the list of revisions
setChanges(List changes)
public void setChanges(List<RevisionInfo> changes)
Sets the list of revisions to be applied.
Parameters:
Parameter | Type | Description |
---|---|---|
changes | java.util.List<com.groupdocs.comparison.words.revision.RevisionInfo> | The list of revisions |
getCommonHandler()
public RevisionAction getCommonHandler()
Gets the common revision action to be applied to all revisions.
Returns: RevisionAction - the common revision action
setCommonHandler(RevisionAction commonHandler)
public void setCommonHandler(RevisionAction commonHandler)
Sets the common revision action to be applied to all revisions.
Parameters:
Parameter | Type | Description |
---|---|---|
commonHandler | RevisionAction | The common revision action |