Class TrimAttributeTagTransformation

  • public class TrimAttributeTagTransformation
    extends org.htmlcleaner.TagTransformation
    This class allows to transform all tags attribute to trim their value from leading space, except for input value. It applies the original tag transformations, and then iterates over the attributes to remove the leading spaces. This class aims at being deleted once HtmlCleaner offers a way to have a better control over trimAttribute flag, see: Note: Even though in a public package this code is not meant to be a public API. We've had to put in under the org.htmlcleaner package because we use the following package protected API: TagTransformation#getSourceTag().
    $Id: f8805037b08432a86c5545f93ff35465705af6a2 $
    • Constructor Detail

      • TrimAttributeTagTransformation

        public TrimAttributeTagTransformation​(String sourceTag,
                                              String destTag)
        Create a TagTransformation from source tag to target tag. This kind of transformation always preserve the attributes.
        sourceTag - Name of the tag to be transformed.
        destTag - Name of tag to which source tag is to be transformed.
    • Method Detail

      • applyTagTransformations

        public Map<String,​String> applyTagTransformations​(Map<String,​String> attributes)
        applyTagTransformations in class org.htmlcleaner.TagTransformation