Package org.exoplatform.commons.diff
Class DiffService
- java.lang.Object
-
- org.exoplatform.commons.diff.DiffService
-
public class DiffService extends Object
Provides different methods which are used for comparing and making a list of differences between content.- eXo level API
- Experimental
-
-
Constructor Summary
Constructors Constructor Description DiffService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringescape(String text)Escapes a string by a common filter.protected List<?>getDeltas(org.suigeneris.jrcs.diff.Revision rev)Gets a list of Delta objects by a wiki page revision.DiffResultgetDifferencesAsHTML(String text1, String text2, boolean allDoc)Gets a Delta object containing line differences in the HTML format between text1 and text2.List<?>getDifferencesAsList(String text1, String text2)Gets a list of Delta objects representing line differences between text1 and text2.DiffResultgetWordDifferencesAsHTML(String text1, String text2)Gets a Delta object containing word differences between text1 and text2.List<?>getWordDifferencesAsList(String text1, String text2)Gets a list of Delta objects representing word differences between text1 and text2.
-
-
-
Method Detail
-
getDifferencesAsList
public List<?> getDifferencesAsList(String text1, String text2) throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Gets a list of Delta objects representing line differences between text1 and text2.- Parameters:
text1- The original content.text2- The revised content.- Returns:
- The list of Delta objects.
- Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException
-
getWordDifferencesAsList
public List<?> getWordDifferencesAsList(String text1, String text2) throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Gets a list of Delta objects representing word differences between text1 and text2.- Parameters:
text1- The original content.text2- The revised content.- Returns:
- The list of Delta objects.
- Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException
-
getWordDifferencesAsHTML
public DiffResult getWordDifferencesAsHTML(String text1, String text2) throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Gets a Delta object containing word differences between text1 and text2.- Parameters:
text1- The original content.text2- The revised content.- Returns:
- The Delta object.
- Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException
-
getDifferencesAsHTML
public DiffResult getDifferencesAsHTML(String text1, String text2, boolean allDoc) throws org.suigeneris.jrcs.diff.DifferentiationFailedException
Gets a Delta object containing line differences in the HTML format between text1 and text2.- Parameters:
text1- The original content.text2- The revised content.allDoc- Shows the whole content.- Returns:
- The Delta object.
- Throws:
org.suigeneris.jrcs.diff.DifferentiationFailedException
-
getDeltas
protected List<?> getDeltas(org.suigeneris.jrcs.diff.Revision rev)
Gets a list of Delta objects by a wiki page revision.- Parameters:
rev- The wiki page revision.- Returns:
- The list of Delta objects.
-
-