Class XmlChange
java.lang.Object
eu.maveniverse.domtrip.XmlChange
Represents a single change detected between two XML documents.
Each change has a type, an XPath-like path
identifying the location, and optional before/after values and node references.
Example output:
ELEMENT_ADDED: /project/dependencies/dependency[3] TEXT_CHANGED: /project/version: "1.0" → "1.1" ATTRIBUTE_CHANGED: /project/dependencies/dependency[2]/@scope: "compile" → "test"
- Since:
- 1.3.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the node after the change, ornullfor removals.Returns the value after the change, ornullfor removals.Returns the node before the change, ornullfor additions.Returns the value before the change, ornullfor additions.booleaninthashCode()booleanReturnstrueif the change is formatting-only (no semantic effect).booleanReturnstrueif the change affects the semantic meaning of the XML.path()Returns the XPath-like path to the changed node.toString()type()Returns the type of change.
-
Constructor Details
-
XmlChange
public XmlChange(ChangeType type, String path, String beforeValue, String afterValue, Node beforeNode, Node afterNode) Creates a new XmlChange.- Parameters:
type- the type of changepath- the XPath-like path to the changed nodebeforeValue- the value before the change, ornullfor additionsafterValue- the value after the change, ornullfor removalsbeforeNode- the node before the change, ornullfor additionsafterNode- the node after the change, ornullfor removals
-
-
Method Details
-
type
-
path
-
isSemantic
public boolean isSemantic()Returnstrueif the change affects the semantic meaning of the XML.- Returns:
trueif semantic
-
isFormattingOnly
public boolean isFormattingOnly()Returnstrueif the change is formatting-only (no semantic effect).- Returns:
trueif formatting-only
-
beforeValue
Returns the value before the change, ornullfor additions.- Returns:
- the before value
-
afterValue
Returns the value after the change, ornullfor removals.- Returns:
- the after value
-
beforeNode
Returns the node before the change, ornullfor additions.- Returns:
- the before node
-
afterNode
Returns the node after the change, ornullfor removals.- Returns:
- the after node
-
toString
-
equals
-
hashCode
-