Package Torello.HTML

Interface Attributes.Filter

  • Enclosing class:
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public static interface Attributes.Filter
    Lambda-target for creating attribute-filters.

    This java functional interface can be implemented by a class, or by a lambda-expression. It is used by the methods in class Attributes that have the name 'filter(...)'. Generally, a user should employ a 'filter' method if he or she wishes to perform a bulk removal of attributes from all of the TagNode's contained by a vectorized-html web-page.

    By implementing an instance of 'Filter', a programmer may selectively choose which attribute key-value pair in each and every TagNode of a web-page, or sub-list, using a single lambda-expression.

    • Method Summary

      @FunctionalInterface (Lambda) Method
      Modifier and Type Method
      boolean filter​(String htmlTag, Properties attributes)
    • Method Detail

      • filter

        boolean filter​(java.lang.String htmlTag,
                       java.util.Properties attributes)
        This receives the contents of a 'TagNode' - after the html-tag and the inner-tags have been extracted. This method is intended to be used to selectively remove specific inner-tags / attributes that the programmer would like to see removed.
        htmlTag - When this method is implemented by a class, or by a lambda-expression, the user will receive a copy of a TagNode's TagNode.tok field through this parameter. The class or lambda-expression which implements method 'filter(...)' may use the String that is passed via the 'htmlTag' parameter to, possibly - if needed, help decide which attributes to remove from the java.util.Properties parameter 'attributes'
        attributes - When this method, 'filter(...)', is implemented by a class or a lambda-expression, he or she is tasked with eliminating any attributes in this Properties class that he wishes to filter.

        NOTE: The key-value pairs of this java.util.Properties method are generated by calling TagNode.allAV(boolean, boolean). The values returned by that method will all have their original quotation-marks included in the 'value' String.

        ALSO: This class is intended to function as a filter, and should be used to remove property key-value pairs from the attributes parameter received here. However, there is nothing stopping the programmer from modifying the contents by adding properties, or even changing the values of the properties.
        This method must return a boolean indicating whether or not the attributes parameter has been changed in any way. If FALSE were returned, but the class or lambda-expression which implements this method has modified the attributes Properties instance, the changes that were made would be lost, and the vectorized-html page that contained the TagNode wouldn't be updated with the new TagNode.
        See Also:
        TagNode.allAV(boolean, boolean), TagNode.tok