Package Torello.HTML
Interface Attributes.Filter
-
- Enclosing class:
- Attributes
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface Attributes.Filter
Lambda-target for creating attribute-filters.
This javafunctional interfacecan be implemented by a class, or by a lambda-expression. It is used by the methods inclass Attributesthat 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 theTagNode'scontained 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 everyTagNodeof a web-page, or sub-list, using a single lambda-expression.
Hi-Lited Source-Code:- View Here: Torello/HTML/Attributes.java
- Open New Browser-Tab: Torello/HTML/Attributes.java
File Size: 2,995 Bytes Line Count: 50 '\n' Characters Found
-
-
Method Summary
@FunctionalInterface: (Lambda) Method Modifier and Type Method booleanfilter(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.
FunctionalInterface Target-Method:
This method corresponds to the@FunctionalInterfaceAnnotation's method requirement. It is the only non-default, non-staticmethod in this interface, and may be the target of a Lambda-Expression or'::'(double-colon) Function-Pointer.- Parameters:
htmlTag- When this method is implemented by a class, or by a lambda-expression, the user will receive a copy of a TagNode'sTagNode.tokfield through this parameter. The class or lambda-expression which implements method'filter(...)'may use theStringthat is passed via the'htmlTag'parameter to, possibly - if needed, help decide which attributes to remove from thejava.util.Propertiesparameter'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 thisPropertiesclass that he wishes to filter.
NOTE: The key-value pairs of thisjava.util.Propertiesmethod are generated by callingTagNode.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.- Returns:
- This method must return a boolean indicating whether or not the attributes
parameter has been changed in any way. If
FALSEwere returned, but the class or lambda-expression which implements this method has modified the attributesPropertiesinstance, the changes that were made would be lost, and the vectorized-html page that contained theTagNodewouldn't be updated with the newTagNode. - See Also:
TagNode.allAV(boolean, boolean),TagNode.tok
-
-