Class NodeClassFilter

java.lang.Object
org.htmlparser.filters.NodeClassFilter
All Implemented Interfaces:
Serializable, Cloneable, NodeFilter

public class NodeClassFilter extends Object implements NodeFilter
This class accepts all tags of a given class.
See Also:
  • Field Details

    • mClass

      protected Class mClass
      The class to match.
  • Constructor Details

    • NodeClassFilter

      public NodeClassFilter()
      Creates a NodeClassFilter that accepts Html tags.
    • NodeClassFilter

      public NodeClassFilter(Class cls)
      Creates a NodeClassFilter that accepts tags of the given class.
      Parameters:
      cls - The class to match.
  • Method Details

    • getMatchClass

      public Class getMatchClass()
      Get the class to match.
      Returns:
      Returns the class.
    • setMatchClass

      public void setMatchClass(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:
      accept in interface NodeFilter
      Parameters:
      node - The node to check.
      Returns:
      true if the node is the right class, false otherwise.