Package org.iirds.dita.ot.plugin.module

# Class ContentHashBuilder

java.lang.Object
org.iirds.dita.ot.plugin.module.ContentHashBuilder

public class ContentHashBuilder extends Object
Generate a hash value of XML content

Author:
  Martin Kreutzer, Empolis Information Management GmbH

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Set<String>`
  `excludeAttributes`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContentHashBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getHash(Element element)`
  Generates a hash of the content of an element.
  `(package private) List<Attr>`
  `getSortedAttributes(Element element)`
  `protected void`
  `update(MessageDigest md, String text)`
  `protected void`
  `update(MessageDigest md, Node root)`

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

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

- ## Field Details

  - ### excludeAttributes

    protected Set<String> excludeAttributes

- ## Constructor Details

  - ### ContentHashBuilder

    public ContentHashBuilder()

- ## Method Details

  - ### getHash

    public String getHash(Element element)
    Generates a hash of the content of an element. Some technical attribute (xtrc, xtrf, xnlns:dita-ot), XML comments, and XML processing instructions are not taken into account. Implementation uses SHA-256.
    Parameters:
      `element` - the element for which to generate a hash
    Returns:
      the hash (hex-encoded)

  - ### update

    protected void update(MessageDigest md, String text)

  - ### getSortedAttributes

    List<Attr> getSortedAttributes(Element element)

  - ### update

    protected void update(MessageDigest md, Node root)