Performs sanitization of a node tree after construction to ensure that it does not contain any disallowed elements or attributes.

In general custom implementations of this class should not be necessary and all validation customization should be done in custom NodeValidators, but custom implementations of this class can be created to perform more complex tree sanitization.

Constructors

NodeTreeSanitizer(NodeValidator validator)

Constructs a default tree sanitizer which will remove all elements and attributes which are not allowed by the provided validator.

Methods

sanitizeTree(Node node) → void

Called with the root of the tree which is to be sanitized.