Package org.htmlparser.filters
Class NodeClassFilter
- java.lang.Object
-
- org.htmlparser.filters.NodeClassFilter
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,NodeFilter
public class NodeClassFilter extends java.lang.Object implements NodeFilter
This class accepts all tags of a given class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ClassmClassThe class to match.
-
Constructor Summary
Constructors Constructor Description NodeClassFilter()Creates a NodeClassFilter that accepts Html tags.NodeClassFilter(java.lang.Class cls)Creates a NodeClassFilter that accepts tags of the given class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Node node)Accept nodes that are assignable from the class provided in the constructor.java.lang.ClassgetMatchClass()Get the class to match.voidsetMatchClass(java.lang.Class cls)Set the class to match.
-
-
-
Method Detail
-
getMatchClass
public java.lang.Class getMatchClass()
Get the class to match.- Returns:
- Returns the class.
-
setMatchClass
public void setMatchClass(java.lang.Class cls)
Set the class to match.- Parameters:
cls- The node class to match.
-
accept
public boolean accept(Node node)
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.
-
-