Package com.deltaxml.api
Class UnorderedDuplicateKeysException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.deltaxml.core.exceptions.DeltaXMLException
com.deltaxml.api.DeltaXMLProcessingException
com.deltaxml.api.UnorderedDuplicateKeysException
- All Implemented Interfaces:
Serializable
An orderless element (one with the deltaxml:ordered='false' attribute) cannot contain more than one child element
with the same name/type (ie. the same namespace URI and localName) and the same deltaxml:key attribute value.
This exception is thrown whenever two such elements are found within the same orderless parent. There may be more than two child elements with the same key value, but only two are reported with an exception within any parent element and key value combination.
Note: the getErrorCode() method is provided for compatibility with earlier XML Compare releases; when
called with this exception the result will be: 46
- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUnorderedDuplicateKeysException(String parentElement, String keyValue, String child1, String child2) Construct a new UnorderedDuplicateKeysException appropriate for use with the XML Compare code. -
Method Summary
Modifier and TypeMethodDescriptionReports the location (XPath) of the first shared-key child.Reports the location (XPath) of the second shared-key child.Reports the XPath of the orderless element.Reports the shared key value.Methods inherited from class com.deltaxml.api.DeltaXMLProcessingException
getErrorCode, getSeverityMethods inherited from class com.deltaxml.core.exceptions.DeltaXMLException
getCause, getThrowableMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnorderedDuplicateKeysException
public UnorderedDuplicateKeysException(String parentElement, String keyValue, String child1, String child2) Construct a new UnorderedDuplicateKeysException appropriate for use with the XML Compare code. Most parameters have their default values.- Parameters:
parentElement- String used to represent the XPath of the erroneous element.keyValue- the value of the duplicated deltaxml:key attributechild1- one of the children with duplicate keyschild2- another child with duplicate keys
-
-
Method Details
-
getIncorrectParentElement
Reports the XPath of the orderless element.- Returns:
- a String corresponding to the XPath of the orderless element containing multiple children with the same key.
-
getKeyValue
Reports the shared key value.- Returns:
- the value of the deltaxml:key attribute which is shared by two or more children
-
getChild1
Reports the location (XPath) of the first shared-key child.- Returns:
- a string corresponding to the XPath of the first child with the shared key.
-
getChild2
Reports the location (XPath) of the second shared-key child.- Returns:
- a string corresponding to the XPath of the another child with the shared key.
-