public class Differencer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
static Integer |
nextId |
| Constructor and Description |
|---|
Differencer() |
| Modifier and Type | Method and Description |
|---|---|
void |
diff(org.docx4j.wml.Body newer,
org.docx4j.wml.Body older,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsNewer,
RelationshipsPart docPartRelsOlder) |
void |
diff(org.docx4j.wml.P pl,
org.docx4j.wml.P pr,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsLeft,
RelationshipsPart docPartRelsRight)
Compare 2 p objects, returning a result containing
w:ins and w:del elements
|
void |
diff(org.docx4j.wml.P pl,
org.docx4j.wml.P pr,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsLeft,
RelationshipsPart docPartRelsRight,
boolean preProcess)
Compare 2 p objects, returning a result containing
w:ins and w:del elements
|
void |
diff(org.docx4j.wml.SdtContentBlock cbNewer,
org.docx4j.wml.SdtContentBlock cbOlder,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsNewer,
RelationshipsPart docPartRelsOlder) |
Map<org.docx4j.relationships.Relationship,Part> |
getComposedRels() |
static Integer |
getId()
The id to be allocated to the ins/del
|
static int[] |
getParagraphRunTextWordCounts(org.docx4j.wml.P p) |
static String |
getRunString(org.docx4j.wml.P p,
int i) |
protected static org.docx4j.wml.P |
loadParagraph(String filename) |
static void |
log(String message) |
static void |
main(String[] args) |
void |
markupAsDeletion(org.docx4j.wml.SdtContentBlock cbLeft,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsRight) |
void |
markupAsInsertion(org.docx4j.wml.SdtContentBlock cbLeft,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsLeft) |
static void |
registerRelationship(Differencer pd,
RelationshipsPart docPartRels,
String relId,
String newRelId)
This is a Xalan extension function, invoked from diffx2wml.xslt
Any rel which is present in the results of the comparison must point to
a valid target of the correct type, or the resulting document will
be broken.
|
void |
setRelsDiffIdentifier(String relsDiffIdentifier) |
static void |
setXsltDiffx2Wml(Templates xsltDiffx2Wml)
org/docx4j/diff/diffx2wml.xslt will be used by default
to transform the diff output into a Word docx with tracked
changes.
|
void |
toWML(String in,
Result result,
String author,
Calendar date,
RelationshipsPart docPartRelsNewer,
RelationshipsPart docPartRelsOlder) |
protected static org.slf4j.Logger log
public static Integer nextId
public static void log(String message)
public Map<org.docx4j.relationships.Relationship,Part> getComposedRels()
public static void setXsltDiffx2Wml(Templates xsltDiffx2Wml)
xsltDiffx2Wml - public static final Integer getId()
public void setRelsDiffIdentifier(String relsDiffIdentifier)
relsDiffIdentifier - the relsDiffIdentifier to setpublic static void registerRelationship(Differencer pd, RelationshipsPart docPartRels, String relId, String newRelId)
public void diff(org.docx4j.wml.P pl, org.docx4j.wml.P pr, Result result, String author, Calendar date, RelationshipsPart docPartRelsLeft, RelationshipsPart docPartRelsRight)
pl - - the left paragraphpr - - the right paragraphresult - public void diff(org.docx4j.wml.SdtContentBlock cbNewer, org.docx4j.wml.SdtContentBlock cbOlder, Result result, String author, Calendar date, RelationshipsPart docPartRelsNewer, RelationshipsPart docPartRelsOlder)
public void diff(org.docx4j.wml.Body newer, org.docx4j.wml.Body older, Result result, String author, Calendar date, RelationshipsPart docPartRelsNewer, RelationshipsPart docPartRelsOlder)
public void toWML(String in, Result result, String author, Calendar date, RelationshipsPart docPartRelsNewer, RelationshipsPart docPartRelsOlder)
public void markupAsInsertion(org.docx4j.wml.SdtContentBlock cbLeft, Result result, String author, Calendar date, RelationshipsPart docPartRelsLeft)
public void markupAsDeletion(org.docx4j.wml.SdtContentBlock cbLeft, Result result, String author, Calendar date, RelationshipsPart docPartRelsRight)
public void diff(org.docx4j.wml.P pl, org.docx4j.wml.P pr, Result result, String author, Calendar date, RelationshipsPart docPartRelsLeft, RelationshipsPart docPartRelsRight, boolean preProcess)
pl - - the left paragraphpr - - the right paragraphresult - protected static org.docx4j.wml.P loadParagraph(String filename) throws Exception
Exceptionpublic static int[] getParagraphRunTextWordCounts(org.docx4j.wml.P p)
public static String getRunString(org.docx4j.wml.P p, int i)
Copyright © 2007-2022. All Rights Reserved.