@API(type=EXTENDABLE,
src=PUBLIC)
public class DiffOptions
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
AUTO
The algorithm is automatically chosen based on content type, text length, options etc.
|
static int |
CHARACTERS_COMPARE
Algorithm based on characters comparison.
|
static int |
LINES_COMPARE
Algorithm based on line by line comparison.
|
static int |
SYNTAX_AWARE
Algorithm based on comparing the syntax tokens.
|
static int |
WORDS_COMPARE
Algorithm based on words comparison.
|
static int |
XML_ACCURATE
XML accurate diff based on Sasha and Zhang algorithm.
|
static int |
XML_FAST
Fast XML hybrid heuristic algorithm.
|
Constructor and Description |
---|
DiffOptions()
Default constructor for default options.
|
DiffOptions(int algorithm,
boolean ignoreWhitespaces,
int maxNumberOfDiffs,
boolean ignorePI,
boolean ignoreComments,
boolean ignoreCDATA,
boolean ignoreDOCTYPE,
boolean ignoreText,
boolean ignoreAttributesOrder,
boolean ignorePrefixes,
boolean ignoreNamespaces,
boolean ignoreNamespaceDeclarations,
boolean ignoreEntities,
boolean mergeAdjacentDifferences,
boolean markEndTagsAsDifferent,
boolean ignoreStateOfEmptyElements)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getAlgorithm() |
java.lang.String |
getDefaultXPath()
Get the default XPath that will be used to ignore nodes from comparison it no XPath
is specified in XPath combo from DIFF Files toolbar.
|
int |
getMaxNumberOfDiffs() |
boolean |
isIgnoreAttributesOrder() |
boolean |
isIgnoreCDATA() |
boolean |
isIgnoreComments() |
boolean |
isIgnoreDOCTYPE() |
boolean |
isIgnoreEntities() |
boolean |
isIgnoreNamespaceDeclarations() |
boolean |
isIgnoreNamespaces() |
boolean |
isIgnoreNodesByXPath()
Check if the default XPath should be used to ignore nodes from comparison if no XPath
is specified in XPath combo from DIFF Files toolbar
|
boolean |
isIgnorePI() |
boolean |
isIgnorePrefixes() |
boolean |
isIgnoreStateOfEmptyElements() |
boolean |
isIgnoreText() |
boolean |
isIgnoreWhitespaces() |
boolean |
isMarkEndTagsAsDifferent() |
boolean |
isMergeAdjacentDifferences() |
void |
setAlgorithm(int algorithm) |
void |
setDefaultXPath(java.lang.String defaultXPath)
Set default XPath that will be used to ignore nodes from comparison it no XPath
is specified in XPath combo from DIFF Files toolbar.
|
void |
setIgnoreAttributesOrder(boolean ignoreAttributesOrder) |
void |
setIgnoreCDATA(boolean ignoreCDATA) |
void |
setIgnoreComments(boolean ignoreComments) |
void |
setIgnoreDOCTYPE(boolean ignoreDOCTYPE) |
void |
setIgnoreEntities(boolean ignoreEntities) |
void |
setIgnoreNamespaceDeclarations(boolean ignoreNamespaceDeclarations) |
void |
setIgnoreNamespaces(boolean ignoreNamespaces) |
void |
setIgnoreNodesByXPath(boolean ignoreNodesByXPath)
Set if the default XPath should be used to ignore nodes from comparison if no XPath
is specified in XPath combo from DIFF Files toolbar
|
void |
setIgnorePI(boolean ignorePI) |
void |
setIgnorePrefixes(boolean ignorePrefixes) |
void |
setIgnoreStateOfEmptyElements(boolean ignoreStateOfEmptyElements) |
void |
setIgnoreText(boolean ignoreText) |
void |
setIgnoreWhitespaces(boolean ignoreWhitespaces) |
void |
setMarkEndTagsAsDifferent(boolean markEndTagsAsDifferent) |
void |
setMaxNumberOfDiffs(int maxNumberOfDiffs) |
void |
setMergeAdjacentDifferences(boolean mergeAdjacentDifferences) |
public static final int AUTO
public static final int CHARACTERS_COMPARE
public static final int WORDS_COMPARE
public static final int LINES_COMPARE
public static final int SYNTAX_AWARE
public static final int XML_FAST
public static final int XML_ACCURATE
public DiffOptions(int algorithm, boolean ignoreWhitespaces, int maxNumberOfDiffs, boolean ignorePI, boolean ignoreComments, boolean ignoreCDATA, boolean ignoreDOCTYPE, boolean ignoreText, boolean ignoreAttributesOrder, boolean ignorePrefixes, boolean ignoreNamespaces, boolean ignoreNamespaceDeclarations, boolean ignoreEntities, boolean mergeAdjacentDifferences, boolean markEndTagsAsDifferent, boolean ignoreStateOfEmptyElements)
algorithm
- The used algorithm, one of the constants:
ignoreWhitespaces
- true
if differences consisting only in whitespaces should be ignored.maxNumberOfDiffs
- The maximum number of modifications you are interested in. If the document contain
a larger number of differences the diff will only signal that they are different and stop after reaching the limit.ignorePI
- true
if processing instructions should be ignored.
It applies when using XML aware algorithms.ignoreComments
- true
if comments should be ignored.
It applies when using XML aware algorithms.ignoreCDATA
- true
if CDATA sections should be ignored.
It applies when using XML aware algorithms.ignoreDOCTYPE
- true
if DOCTYPE sections should be ignored.
It applies when using XML aware algorithms.ignoreText
- true
if differences in the text content should be ignored.
It applies when using XML aware algorithms.ignoreAttributesOrder
- true
if the order of the attributes should be ignored.
It applies when using XML aware algorithms.ignorePrefixes
- true
if the prefixes should be ignored.
Even if this is set the comparing takes into account the namespacea.
It applies when using XML aware algorithms.ignoreNamespaces
- true
if namespaces should be ignored.
It applies when using XML aware algorithms.ignoreNamespaceDeclarations
- true
if the namespace declaration ("xmlns" attributes) should be ignored.
It applies when using XML aware algorithms.ignoreEntities
- true
if entity content should be ignored.
It applies when using XML aware algorithms.mergeAdjacentDifferences
- true
if adjacent differences should be merged and present as a single difference.
Applies when using XML aware algorithms.markEndTagsAsDifferent
- true
if end tags with the same name for elements that are different in other sense
will be shown as different also.
It applies when using XML aware algorithms.ignoreStateOfEmptyElements
- true
if sequences representing empty elements like
<a/> and <a></a>
public DiffOptions()
public int getAlgorithm()
public void setAlgorithm(int algorithm)
algorithm
- The algorithm to use, one of the constants:
public int getMaxNumberOfDiffs()
public void setMaxNumberOfDiffs(int maxNumberOfDiffs)
maxNumberOfDiffs
- The maximum number of modifications you are interested in. If the document contain
a larger number of differences the diff will only signal that they are different and stop after reaching the limit.public boolean isIgnoreWhitespaces()
true
if differences consisting only in whitespaces will be ignored.public void setIgnoreWhitespaces(boolean ignoreWhitespaces)
ignoreWhitespaces
- true
if differences consisting only in whitespaces should be ignored.public boolean isIgnorePI()
true
if processing instructions are ignored.
It applies when using XML aware algorithms.public void setIgnorePI(boolean ignorePI)
ignorePI
- true
if processing instructions should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreComments()
true
if comments are be ignored.
It applies when using XML aware algorithms.public void setIgnoreComments(boolean ignoreComments)
ignoreComments
- true
if comments should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreCDATA()
true
if CDATA sections are ignored.
It applies when using XML aware algorithms.public void setIgnoreCDATA(boolean ignoreCDATA)
ignoreCDATA
- true
if CDATA sections should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreDOCTYPE()
true
if DOCTYPE sections are ignored.
It applies when using XML aware algorithms.public void setIgnoreDOCTYPE(boolean ignoreDOCTYPE)
ignoreDOCTYPE
- true
if DOCTYPE sections should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreText()
public void setIgnoreText(boolean ignoreText)
ignoreText
- code>true if differences in the text content should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreAttributesOrder()
true
if the order of the attributes is ignored.
It applies when using XML aware algorithms.public void setIgnoreAttributesOrder(boolean ignoreAttributesOrder)
ignoreAttributesOrder
- true
if the order of the attributes should be ignored.
It applies when using XML aware algorithms.public boolean isIgnorePrefixes()
public void setIgnorePrefixes(boolean ignorePrefixes)
ignorePrefixes
- code>true if the prefixes should be ignored.
Even if this is set the comparing takes into account the namespaces.
It applies when using XML aware algorithms.public boolean isIgnoreNamespaces()
true
if namespaces are ignored.
It applies when using XML aware algorithms.public void setIgnoreNamespaces(boolean ignoreNamespaces)
ignoreNamespaces
- true
if namespaces should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreNamespaceDeclarations()
true
if the namespace declarations ("xmlns" attributes) are ignored.
It applies when using XML aware algorithms.public void setIgnoreNamespaceDeclarations(boolean ignoreNamespaceDeclarations)
ignoreNamespaceDeclarations
- true
if the namespace declarations ("xmlns" attributes) should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreEntities()
true
if entity content is ignored.
It applies when using XML aware algorithms.public void setIgnoreEntities(boolean ignoreEntities)
ignoreEntities
- true
if entity content should be ignored.
It applies when using XML aware algorithms.public boolean isIgnoreStateOfEmptyElements()
true
if sequences representing empty elements like
<a/> and <a></a>
public void setIgnoreStateOfEmptyElements(boolean ignoreStateOfEmptyElements)
ignoreStateOfEmptyElements
- true
if sequences representing empty elements like
<a/> and <a></a>
public boolean isMergeAdjacentDifferences()
true
if adjacent differences are merged and present as a single difference.
It applies when using XML aware algorithms.public void setMergeAdjacentDifferences(boolean mergeAdjacentDifferences)
mergeAdjacentDifferences
- true
if adjacent differences should be merged and present as a single difference.
It applies when using XML aware algorithms.public boolean isMarkEndTagsAsDifferent()
true
if end tags with the same name for elements that are
different in other sense are shown as different also.
It applies when using XML aware algorithms.public void setMarkEndTagsAsDifferent(boolean markEndTagsAsDifferent)
markEndTagsAsDifferent
- true
if end tags with the same name for elements
that are different in other sense will be shown as different also.
It applies when using XML aware algorithms.public boolean isIgnoreNodesByXPath()
true
if the default XPath expression should be used to ignore nodes from
comparison if no other XPath is specified in XPath combo from DIFF Files toolbarpublic void setIgnoreNodesByXPath(boolean ignoreNodesByXPath)
ignoreNodesByXPath
- true
to use the default XPath should be used to ignore
nodes from comparison if no XPath is specified in XPath combo from DIFF Files toolbarpublic java.lang.String getDefaultXPath()
public void setDefaultXPath(java.lang.String defaultXPath)
defaultXPath
- The default XPath that will be used to ignore nodes from comparison it no XPath
is specified in XPath combo from DIFF Files toolbar.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.