Class SimpleFilter

  • Direct Known Subclasses:
    ElementFilter

    public class SimpleFilter
    extends SMFilter
    Simple bit-set based filter that can be configured by specifying allowed event types. Such filters are immutable and can be easily shared, but can only be used if checks are strictly based on only event type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int mAllowedTypes  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(SMEvent evt, SMInputCursor caller)
      Methods iterators call to check whether specified event should be return, or filtered out.
      SimpleFilter extend​(int additionalFlags, int removeFlags)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mAllowedTypes

        final int mAllowedTypes
    • Constructor Detail

      • SimpleFilter

        public SimpleFilter​(int typeFlags)
      • SimpleFilter

        public SimpleFilter​(SMEvent eventToMatch)
    • Method Detail

      • extend

        public SimpleFilter extend​(int additionalFlags,
                                   int removeFlags)
      • accept

        public boolean accept​(SMEvent evt,
                              SMInputCursor caller)
                       throws javax.xml.stream.XMLStreamException
        Description copied from class: SMFilter
        Methods iterators call to check whether specified event should be return, or filtered out.
        Specified by:
        accept in class SMFilter
        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:
        javax.xml.stream.XMLStreamException