Package org.htmlparser.filters
Class NodeClassFilter
java.lang.Object
org.htmlparser.filters.NodeClassFilter
- All Implemented Interfaces:
Serializable,Cloneable,NodeFilter
This class accepts all tags of a given class.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a NodeClassFilter that accepts Html tags.NodeClassFilter(Class cls) Creates a NodeClassFilter that accepts tags of the given class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccept nodes that are assignable from the class provided in the constructor.Get the class to match.voidsetMatchClass(Class cls) Set the class to match.
-
Field Details
-
mClass
The class to match.
-
-
Constructor Details
-
NodeClassFilter
public NodeClassFilter()Creates a NodeClassFilter that accepts Html tags. -
NodeClassFilter
Creates a NodeClassFilter that accepts tags of the given class.- Parameters:
cls- The class to match.
-
-
Method Details
-
getMatchClass
Get the class to match.- Returns:
- Returns the class.
-
setMatchClass
Set the class to match.- Parameters:
cls- The node class to match.
-
accept
Accept nodes that are assignable from the class provided in the constructor.- Specified by:
acceptin interfaceNodeFilter- Parameters:
node- The node to check.- Returns:
trueif the node is the right class,falseotherwise.
-