public class ChangeInfo extends Object
It provides details such as the type of change, the affected area, and the content before and after the change. Use this class to retrieve information about individual changes within a comparison result.
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
comparer.compare(resultFile);
// Get a list of changes from the comparison result
ChangeInfo[] changes = comparer.getChanges();
// Iterate through the changes and retrieve information
for (ChangeInfo change : changes) {
ChangeType changeType = change.getType();
String componentType = change.getComponentType();
PageInfo pageInfo = change.getPageInfo();
// Process the change information as needed
// ...
}
}
Comparer,
ChangeType,
PageInfo| Constructor and Description |
|---|
ChangeInfo() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAuthors()
Gets the list of authors.
|
Rectangle |
getBox()
Gets coordinates of changed element on the page.
|
ComparisonAction |
getComparisonAction()
Gets the action that will be applied to the change.
|
String |
getComponentType()
Gets the type of the changed component.
|
int |
getId()
Gets unique id of the change.
|
PageInfo |
getPageInfo()
Gets information about the page, on which current change was found.
|
String |
getSourceText()
Gets changed text from source document.
|
List<StyleChangeInfo> |
getStyleChanges()
Gets the list of style changes.
|
String |
getTargetText()
Gets changed text from target document.
|
String |
getText()
Gets text value of the change.
|
ChangeType |
getType()
Gets the type of the change represented by enum
ChangeType. |
void |
setAuthors(List<String> value)
Sets the list of authors.
|
void |
setBox(Rectangle value)
Sets coordinates of changed element on the page.
|
void |
setComparisonAction(ComparisonAction value)
Sets the action that should be applied to the change.
|
void |
setComponentType(String value)
Sets the type of the changed component.
|
void |
setId(int value)
Sets unique id of the change.
|
void |
setPageInfo(PageInfo value)
Sets information about the page, on which current change was found.
|
void |
setSourceText(String value)
Sets changed text from source document.
|
void |
setStyleChanges(List<StyleChangeInfo> value)
Sets the list of style changes.
|
void |
setTargetText(String value)
Sets changed text from target document.
|
void |
setText(String value)
Sets text value of the change.
|
String |
toString() |
public final List<String> getAuthors()
Gets the list of authors.
public final Rectangle getBox()
Gets coordinates of changed element on the page.
public final ComparisonAction getComparisonAction()
Gets the action that will be applied to the change.
Action (ComparisonAction.ACCEPT or ComparisonAction.REJECT) tells comparison what to do with this change.public String getComponentType()
Gets the type of the changed component.
public final int getId()
Gets unique id of the change.
public final PageInfo getPageInfo()
Gets information about the page, on which current change was found.
public String getSourceText()
Gets changed text from source document.
public final List<StyleChangeInfo> getStyleChanges()
Gets the list of style changes.
public String getTargetText()
Gets changed text from target document.
public final String getText()
Gets text value of the change.
public final ChangeType getType()
Gets the type of the change represented by enum ChangeType.
public final void setAuthors(List<String> value)
Sets the list of authors.
value - The list of authorspublic final void setBox(Rectangle value)
Sets coordinates of changed element on the page.
value - Coordinates of changed element, not nullpublic final void setComparisonAction(ComparisonAction value)
Sets the action that should be applied to the change.
Action (ComparisonAction.ACCEPT or ComparisonAction.REJECT) tells comparison what to do with this change.value - The action that should be applied to the changepublic void setComponentType(String value)
Sets the type of the changed component.
value - The type of the changed componentpublic final void setId(int value)
Sets unique id of the change.
value - The id of the changepublic final void setPageInfo(PageInfo value)
Sets information about the page, on which current change was found.
value - Information about the pagepublic void setSourceText(String value)
Sets changed text from source document.
value - The changed textpublic final void setStyleChanges(List<StyleChangeInfo> value)
Sets the list of style changes.
value - The list of style changespublic void setTargetText(String value)
Sets changed text from target document.
value - The changed textpublic final void setText(String value)
Sets text value of the change.
value - Text value of the changeCopyright © 2024. All rights reserved.