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 interface
can be implemented by a class, or by a lambda-expression. It is used by the methods inclass 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 theTagNode'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 everyTagNode
of 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 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.
FunctionalInterface Target-Method:
This method corresponds to the@FunctionalInterface
Annotation's method requirement. It is the only non-default
, non-static
method 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.tok
field through this parameter. The class or lambda-expression which implements method'filter(...)'
may use theString
that is passed via the'htmlTag'
parameter to, possibly - if needed, help decide which attributes to remove from thejava.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 thisProperties
class that he wishes to filter.
NOTE: The key-value pairs of thisjava.util.Properties
method 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
FALSE
were returned, but the class or lambda-expression which implements this method has modified the attributesProperties
instance, the changes that were made would be lost, and the vectorized-html page that contained theTagNode
wouldn't be updated with the newTagNode
. - See Also:
TagNode.allAV(boolean, boolean)
,TagNode.tok
-
-