ApplyRevisionOptions
Leave feedback
On this page
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);
}
| 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. |
| 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. |
public ApplyRevisionOptions()
Initializes a new instance of the ApplyRevisionOptions class.
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 |
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 |
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 |
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
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 |
public RevisionAction getCommonHandler()
Gets the common revision action to be applied to all revisions.
Returns: RevisionAction - the common revision action
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 |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.