@JsonData
public class Modification
extends java.lang.Object
implements java.io.Serializable
Modification
is the smallest change description in the differences model of i-net PDFC. It contains a set
of subsequent elements which were all modified in the same manner and thus are of the same basic ElementType
.
'Subsequent' refers here to left-to-right top-down order which i-net PDFC assumes as reading order. This order
might by modified by filter (e.G. the 'multi column' filter), so please mind that this 'reading order' is not
necessarily a strict Y-X order!Modifier and Type | Class and Description |
---|---|
static class |
Modification.ModificationType
The type of the modification which side has modifications and whether the changes do apply-
This is loosely coupled to the severity type of
DiffGroup s. |
Constructor and Description |
---|
Modification(DiffGroup.GroupType sourceType,
java.util.List<com.inet.pdfc.model.PagedElement> affectedFirst,
java.util.List<com.inet.pdfc.model.PagedElement> affectedSecond,
java.util.List<AttributeDifference<?>> changes)
Creates a modification description for a list of elements.
|
Modification(DiffGroup.GroupType sourceType,
com.inet.pdfc.model.PagedElement affectedFirst,
com.inet.pdfc.model.PagedElement affectedSecond,
java.util.List<AttributeDifference<?>> changes)
Creates a modification description for a pair of elements.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<com.inet.pdfc.model.PagedElement> |
getAffectedElements(boolean first)
Returns a list of element, affected by this modification in either document
|
T |
getAttributeDifference(java.lang.Class<T> type)
Returns a certain tyoe of changes which was applied to all affected elements.
|
java.util.List<AttributeDifference<?>> |
getAttributeDifferences()
Returns a list of changes which was applied to all affected elements.
|
com.inet.pdfc.model.ElementType |
getContentType()
Returns the base type of the elements in this modification.
|
DifferencePages |
getDifferencePages(boolean first)
Return the difference pageNumbers or null if no elements exist for this document
|
java.lang.String |
getMessage()
Returns a log message which describes this modification.
|
Modification.ModificationType |
getModificationType()
Returns the type of modification described by this instance
|
DiffGroup.GroupType |
getSourceType()
|
boolean |
isShouldPageElementMerge()
A flag, for merge the pageElements to one elements
|
boolean |
isVisible()
Returns whether or not this difference will be displayed in any rendered output.
|
void |
setShouldMerge(boolean shouldMerge)
A flag, for merge the pageElements to one elements
|
void |
setVisible(boolean visible)
Defines whether or not this difference will be displayed in any rendered output.
|
public Modification(DiffGroup.GroupType sourceType, java.util.List<com.inet.pdfc.model.PagedElement> affectedFirst, java.util.List<com.inet.pdfc.model.PagedElement> affectedSecond, java.util.List<AttributeDifference<?>> changes)
sourceType
- the source DiffGroup.GroupType
type, must not be null
affectedFirst
- the affected elements in the first document, may be null
affectedSecond
- the affected elements in the second document, may be null
changes
- the list if attribute changes, must not be null or empty, if the
sourceType is DiffGroup.GroupType.Modified
or DiffGroup.GroupType.MetadataChanged
java.lang.IllegalArgumentException
- in case of inconsistent data:DiffGroup.GroupType.AddedOrRemoved
DiffGroup.GroupType.MetadataChanged
or DiffGroup.GroupType.Modified
DiffGroup.GroupType.AddedOrRemoved
or DiffGroup.GroupType.Replaced
public Modification(DiffGroup.GroupType sourceType, com.inet.pdfc.model.PagedElement affectedFirst, com.inet.pdfc.model.PagedElement affectedSecond, java.util.List<AttributeDifference<?>> changes)
sourceType
- the source DiffGroup.GroupType
type, must not be null
affectedFirst
- the affected element in the first document, must not be not null
affectedSecond
- the affected element in the second document, must not be not null
changes
- the list if attribute changes, must not be null
or emptyjava.lang.IllegalArgumentException
- in case of inconsistent data:public void setShouldMerge(boolean shouldMerge)
shouldMerge
- true for merge all pageElements, otherwise falsepublic boolean isShouldPageElementMerge()
public Modification.ModificationType getModificationType()
Modification.ModificationType
public DifferencePages getDifferencePages(boolean first)
first
- true
for the first document, false
public DiffGroup.GroupType getSourceType()
DiffGroup.GroupType
of the DiffGroup
which contains this Modification
DiffGroup.GroupType
public java.util.List<com.inet.pdfc.model.PagedElement> getAffectedElements(boolean first)
first
- true to get the effected element in the first document, false for the second documentnull
but may be emptypublic com.inet.pdfc.model.ElementType getContentType()
public java.util.List<AttributeDifference<?>> getAttributeDifferences()
Modification.ModificationType
is Modification.ModificationType.attributeDifference
, otherwise it will
return null
. com.inet.pdfc.generator.model.diff
package for all available types.null
public T getAttributeDifference(java.lang.Class<T> type)
AttributeDifference
if the Modification.ModificationType
is Modification.ModificationType.attributeDifference
and there is a change of exactly that type, otherwise it will return null
.type
- the exact type of the AttributeDifference
to getnull
public java.lang.String getMessage()
Locale
.new ModificationFormatter().format( this )
public boolean isVisible()
DiffGroup.GroupType
s to
allow to hide distinct differences.true
if the difference is to be rendered, false
if the difference must not be shown in any graphical outputpublic void setVisible(boolean visible)
DiffGroup.GroupType
s to
allow to hide distinct differences.visible
- true
if the difference is to be rendered, false
if the difference must not be shown in any graphical outputCopyright © 2010-2022 by i-net software GmbH