public class Rule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char |
STATUS_DIFFERENT
Identifies the fact that the left and right nodes are different.
|
static char |
STATUS_IDENTICAL
Identifies the fact that the left and right nodes are identical.
|
static char |
STATUS_UPDATED
Identifies the fact that the left and right nodes are updated.
|
Constructor and Description |
---|
Rule() |
Modifier and Type | Method and Description |
---|---|
void |
addDescriptionAttribute(java.lang.String attrName)
Add an attribute which is considered as a description attribute for this rule.
|
void |
addExcludedAttribute(java.lang.String attrName)
Add an attribute which is excluded by this rule.
|
void |
addIdentificationAttribute(java.lang.String attrName)
Add an attribute which is managed by this rule.
|
RuleRegexReplace |
createRuleCDATARegexReplace()
Create the regex replacement rule for the CDATA content.
|
RuleRegexReplace |
createRuleDescriptionRegexReplace()
Create the regex replacement rule for the description attributes.
|
boolean |
equals(org.mdiutil.xml.tree.XMLNode node1,
org.mdiutil.xml.tree.XMLNode node2)
Return true if two nodes are considered equal.
|
char |
getCDATATrimType()
Return the type of trim on on CDATA content.
|
char |
getComparisonMode()
Return the comparison mode.
|
java.util.Set<java.lang.String> |
getDescriptionAttributes()
Return the attributes which are considered as description attributes by this rule.
|
char |
getDescriptionTrimType()
Return the type of trim on description attributes.
|
java.util.Set<java.lang.String> |
getExcludedAttributes()
Return the attributes which are excluded by this rule.
|
java.lang.String |
getID()
Return the rule id.
|
java.util.Set<java.lang.String> |
getIdentificationAttributes()
Return the attributes which are managed by this rule.
|
RuleRegexReplace |
getRuleCDATARegexReplace()
Return the regex replacement rule for the CDATA content.
|
RuleRegexReplace |
getRuleDescriptionRegexReplace()
Return the regex replacement rule for the description attributes.
|
char |
getStatus(org.mdiutil.xml.tree.XMLNode leftNode,
org.mdiutil.xml.tree.XMLNode rightNode)
Return the status of attributes comparisons for this rule.
|
boolean |
hasRuleCDATARegexReplace()
Return true if there is the regex replacement rule for the CDATA content.
|
boolean |
hasRuleDescriptionRegexReplace()
Return true if there is the regex replacement rule for the description attributes.
|
boolean |
isComparingCDATA()
Return true if CDATA content is compared.
|
boolean |
isDescriptionAttribute(java.lang.String attrName)
Return true if an attribute is considered as a description attribute for this rule.
|
boolean |
isKeepingCDATANewLines()
Return true if new lines at the end of CDATA will be kept.
|
boolean |
isOrderSignificant()
Return true if the ordering of nodes is significant.
|
boolean |
isRemovingDescriptionNewLines()
Return true if new lines at the end of description attributes will be removed.
|
void |
removeCDATANewLines(boolean keepCDATANewLines)
Set the way CDATA new lines are considered.
|
void |
removeDescriptionNewLines(boolean removeDescriptionNewLines)
Set the way CDATA new lines are considered.
|
void |
setCDATATrimType(char trimType)
Set the type of trim on CDATA content.
|
void |
setCompareCDATA(boolean compareCDATA)
Set if CDATA content is compared.
|
void |
setComparisonMode(char comparisonMode)
Set the comparison mode.
|
void |
setDescriptionTrimType(char trimType)
Set the type of trim on description attributes.
|
void |
setID(java.lang.String id)
Set the rule id.
|
void |
setOrderIsSignificant(boolean orderIsSignificant)
Set if the ordering of nodes is significant.
|
java.lang.String |
toString() |
public static final char STATUS_IDENTICAL
public static final char STATUS_DIFFERENT
public static final char STATUS_UPDATED
public void setID(java.lang.String id)
id
- the idpublic java.lang.String getID()
public java.lang.String toString()
toString
in class java.lang.Object
public void setCompareCDATA(boolean compareCDATA)
compareCDATA
- true if CDATA content is comparedpublic boolean isComparingCDATA()
public void setOrderIsSignificant(boolean orderIsSignificant)
orderIsSignificant
- true if the ordering of nodes is significantpublic boolean isOrderSignificant()
public void removeCDATANewLines(boolean keepCDATANewLines)
keepCDATANewLines
- true if new lines at the end of CDATA will be keptpublic boolean isKeepingCDATANewLines()
public void removeDescriptionNewLines(boolean removeDescriptionNewLines)
removeDescriptionNewLines
- true if new lines at the end of description attributes will be removedpublic boolean isRemovingDescriptionNewLines()
public void setDescriptionTrimType(char trimType)
trimType
- the type of trimpublic char getDescriptionTrimType()
public void setCDATATrimType(char trimType)
trimType
- the type of trimpublic char getCDATATrimType()
public void setComparisonMode(char comparisonMode)
comparisonMode
- the comparison modeNodeComparisonMode
public char getComparisonMode()
NodeComparisonMode
public java.util.Set<java.lang.String> getIdentificationAttributes()
public void addIdentificationAttribute(java.lang.String attrName)
attrName
- the attribute namepublic java.util.Set<java.lang.String> getExcludedAttributes()
public void addExcludedAttribute(java.lang.String attrName)
attrName
- the attribute namepublic void addDescriptionAttribute(java.lang.String attrName)
attrName
- the attribute namepublic java.util.Set<java.lang.String> getDescriptionAttributes()
public boolean isDescriptionAttribute(java.lang.String attrName)
attrName
- the attribute namepublic char getStatus(org.mdiutil.xml.tree.XMLNode leftNode, org.mdiutil.xml.tree.XMLNode rightNode)
STATUS_IDENTICAL
if the nodes are considered identicalSTATUS_DIFFERENT
if the nodes are considered two different nodesSTATUS_UPDATED
if the nodes are considered to be the same node but their content is updatedleftNode
- the left XML noderightNode
- the right XML nodepublic boolean equals(org.mdiutil.xml.tree.XMLNode node1, org.mdiutil.xml.tree.XMLNode node2)
node1
- the first nodenode2
- the second nodepublic RuleRegexReplace createRuleDescriptionRegexReplace()
public RuleRegexReplace getRuleDescriptionRegexReplace()
public boolean hasRuleDescriptionRegexReplace()
public RuleRegexReplace createRuleCDATARegexReplace()
public RuleRegexReplace getRuleCDATARegexReplace()
public boolean hasRuleCDATARegexReplace()
Copyright © 2024 HervĂ© Girod. All Rights Reserved. Documentation and source under the BSD licence