Class SMFilter

java.lang.Object
org.codehaus.staxmate.in.SMFilter
Direct Known Subclasses:
SimpleFilter

public abstract class SMFilter extends Object
Simple class that defines for objects used to configure iterators so that they will filter out "uninteresting" events.

Note: instances can do other things too (keep track of things they iterate over) if they are stateful; for example, collect text, or validate structure, although main purpose is filtering.

  • Constructor Details

    • SMFilter

      public SMFilter()
  • Method Details

    • accept

      public abstract boolean accept(SMEvent evt, SMInputCursor caller) throws XMLStreamException
      Methods iterators call to check whether specified event should be return, or filtered out.
      Parameters:
      evt - Enumerated (type of the) event that would be passed/filtered
      caller - Iterator that is calling this filter. Note that at this point it is possible that not all state information of iterator have been updated; however, its stream reader should be accessible, as well as tracked element information PRIOR to current node (which may or may not be a start element)
      Returns:
      If true, event is to be returned; if false, it should be filtered out.
      Throws:
      XMLStreamException