org.appng.testsupport.validation

## Class AttributeValueDifferenceHandler

- java.lang.Object
- - org.appng.testsupport.validation.DifferenceHandler
  - - org.appng.testsupport.validation.AttributeValueDifferenceHandler

- All Implemented Interfaces:
    org.custommonkey.xmlunit.DifferenceListener

      public class AttributeValueDifferenceHandler
      extends DifferenceHandler

  A `DifferenceListener` which ignores the values of certain attributes.
  For example, if setting up a `AttributeValueDifferenceHandler` like this

       DifferenceHandler handler = new AttributeValueDifferenceHandler("required");

  the following nodes would be considered as identical:

       <field name="foo" type="text" required="true">
        <value>bar</value>
       </field>

  and

       <field name="foo" type="text" required="false">
        <value>bar</value>
       </field>

  Note `AttributeValueDifferenceHandler` is getting applied to the whole document, ignoring every `Difference` in the value of any attribute with the defined name. If a more precise distinction is required, use `XPathDifferenceHandler` instead.
  Author:
    Matthias Müller

- - ### Field Summary

    - ### Fields inherited from interface org.custommonkey.xmlunit.DifferenceListener

      `RETURN_ACCEPT_DIFFERENCE, RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL, RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR, RETURN_UPGRADE_DIFFERENCE_NODES_DIFFERENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttributeValueDifferenceHandler(String... ignored)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `differenceFound(org.custommonkey.xmlunit.Difference difference)`

    - ### Methods inherited from class org.appng.testsupport.validation.DifferenceHandler

      `skippedComparison`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AttributeValueDifferenceHandler

          public AttributeValueDifferenceHandler(String... ignored)

      Parameters:
        `ignored` - name(s) of the attribute(s) to ignore the value for

  - ### Method Detail

    - #### differenceFound

          public int differenceFound(org.custommonkey.xmlunit.Difference difference)

      Specified by:
        `differenceFound` in interface `org.custommonkey.xmlunit.DifferenceListener`
      Specified by:
        `differenceFound` in class `DifferenceHandler`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.