public enum RevisionType extends Enum<RevisionType>
Example usage:
try (RevisionHandler revisionHandler = new RevisionHandler(sourceFile)) {
List<RevisionInfo> 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);
}
RevisionHandler,
ApplyRevisionOptions,
RevisionInfo,
RevisionAction| Enum Constant and Description |
|---|
DELETION
Represents a type when content was removed from the document.
|
FORMAT_CHANGE
Represents a type when change of formatting was applied to the parent node.
|
INSERTION
Represents a type when new content was inserted in the document.
|
MOVING
Represents a type when content was moved in the document.
|
STYLE_DEFINITION_CHANGE
Represents a type when change of formatting was applied to the parent style.
|
| Modifier and Type | Method and Description |
|---|---|
static RevisionType |
fromInt(int toIntValue)
Creates new constant of enum RevisionType using provided numeric value.
|
static RevisionType |
fromString(String toStringValue)
Parses string representation of RevisionType to get the enum constant.
|
int |
toInt()
Numeric representation of RevisionType.
|
String |
toString()
String representation of RevisionType.
|
static RevisionType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RevisionType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RevisionType DELETION
public static final RevisionType FORMAT_CHANGE
public static final RevisionType INSERTION
public static final RevisionType MOVING
public static final RevisionType STYLE_DEFINITION_CHANGE
public static RevisionType fromInt(int toIntValue)
Creates new constant of enum RevisionType using provided numeric value.
toIntValue - The numeric representation of RevisionTypeIllegalArgumentException - if numeric value is not one of RevisionType valuespublic static RevisionType fromString(String toStringValue)
Parses string representation of RevisionType to get the enum constant.
toStringValue - The string representation of RevisionTypeIllegalArgumentException - if string is not one of RevisionType valuespublic int toInt()
Numeric representation of RevisionType.
public String toString()
String representation of RevisionType.
toString in class Enum<RevisionType>public static RevisionType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static RevisionType[] values()
for (RevisionType c : RevisionType.values()) System.out.println(c);
Copyright © 2024. All rights reserved.