Enum ChangeType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ChangeType>

    public enum ChangeType
    extends java.lang.Enum<ChangeType>
    Enumerates the types of changes that can be detected between two XML documents.

    Change types are classified as either semantic (affecting the meaning of the XML) or formatting-only (affecting only the presentation). This classification enables filtering to focus on meaningful changes while ignoring formatting noise.

    Since:
    1.3.0
    See Also:
    XmlChange, XmlDiff
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isFormattingOnly()
      Returns whether this change type represents a formatting-only change that does not affect the semantic meaning of the XML document.
      boolean isSemantic()
      Returns whether this change type represents a semantic change that affects the meaning of the XML document.
      static ChangeType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ChangeType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • ELEMENT_ADDED

        public static final ChangeType ELEMENT_ADDED
        A new element was inserted.
      • ELEMENT_REMOVED

        public static final ChangeType ELEMENT_REMOVED
        An element was deleted.
      • ELEMENT_MOVED

        public static final ChangeType ELEMENT_MOVED
        An element was reordered among its siblings (same content, different position).
      • TEXT_CHANGED

        public static final ChangeType TEXT_CHANGED
        Text content of an element was modified.
      • ATTRIBUTE_ADDED

        public static final ChangeType ATTRIBUTE_ADDED
        A new attribute was added to an existing element.
      • ATTRIBUTE_REMOVED

        public static final ChangeType ATTRIBUTE_REMOVED
        An attribute was removed from an element.
      • ATTRIBUTE_CHANGED

        public static final ChangeType ATTRIBUTE_CHANGED
        An attribute value was modified.
      • ATTRIBUTE_MOVED

        public static final ChangeType ATTRIBUTE_MOVED
        An attribute was moved.
      • COMMENT_ADDED

        public static final ChangeType COMMENT_ADDED
        A comment was inserted.
      • COMMENT_REMOVED

        public static final ChangeType COMMENT_REMOVED
        A comment was deleted.
      • COMMENT_CHANGED

        public static final ChangeType COMMENT_CHANGED
        Comment content was modified.
      • PI_ADDED

        public static final ChangeType PI_ADDED
        A processing instruction was inserted.
      • PI_REMOVED

        public static final ChangeType PI_REMOVED
        A processing instruction was deleted.
      • PI_CHANGED

        public static final ChangeType PI_CHANGED
        A processing instruction was modified.
      • NAMESPACE_CHANGED

        public static final ChangeType NAMESPACE_CHANGED
        A namespace declaration was modified.
      • WHITESPACE_CHANGED

        public static final ChangeType WHITESPACE_CHANGED
        Indentation or spacing changed (formatting only, no semantic effect).
      • QUOTE_STYLE_CHANGED

        public static final ChangeType QUOTE_STYLE_CHANGED
        Attribute quote style changed between single and double (formatting only).
      • ENTITY_FORM_CHANGED

        public static final ChangeType ENTITY_FORM_CHANGED
        Entity encoding form changed, e.g. &lt; vs &#60; (formatting only).
      • EMPTY_ELEMENT_STYLE_CHANGED

        public static final ChangeType EMPTY_ELEMENT_STYLE_CHANGED
        Empty element style changed between self-closing and expanded (formatting only).
    • Method Detail

      • values

        public static ChangeType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ChangeType c : ChangeType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ChangeType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isSemantic

        public boolean isSemantic()
        Returns whether this change type represents a semantic change that affects the meaning of the XML document.
        Returns:
        true if the change is semantic, false if formatting-only
      • isFormattingOnly

        public boolean isFormattingOnly()
        Returns whether this change type represents a formatting-only change that does not affect the semantic meaning of the XML document.
        Returns:
        true if the change is formatting-only, false if semantic