com.voytechs.jnetstream.codec.filter
Class Filter

java.lang.Object
  extended by com.voytechs.jnetstream.codec.filter.Filter
All Implemented Interfaces:
DecoderListener

public class Filter
extends java.lang.Object
implements DecoderListener

Applies a filter as the packets are being decoded.


Constructor Summary
Filter(java.lang.String expression, Linker linker)
          Initializes the filter with the given expression.
 
Method Summary
 Node getExpressionAST()
           
 java.lang.String getFilterExpression()
           
 void processDecoderEvent(DecoderEvent event)
          Catches Decoder event that was fired.
 void setExpression(java.lang.String exp)
          Sets the current filter expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter(java.lang.String expression,
              Linker linker)
       throws SyntaxError,
              NodeException
Initializes the filter with the given expression.

Parameters:
expression - Filter expression to parse
linker - Linker object which can link our filter expression
Throws:
SyntaxError - Any syntax errors in the filter expression
NodeException - Any filter runtime exceptions
Method Detail

processDecoderEvent

public void processDecoderEvent(DecoderEvent event)
                         throws AssertFailure
Catches Decoder event that was fired.

Specified by:
processDecoderEvent in interface DecoderListener
Parameters:
event - Decoder Event to be processed
Throws:
AssertFailure - Causes the current NPL structure being to be discarded. Such as Header, Packet or Field.
See Also:
DecoderEvent

setExpression

public void setExpression(java.lang.String exp)
                   throws SyntaxError,
                          NodeException
Sets the current filter expression. The expression is parsed and as packets are decoded applied to each.

Parameters:
exp - The filter expression to be parsed and linked
Throws:
SyntaxError
NodeException

getExpressionAST

public Node getExpressionAST()

getFilterExpression

public java.lang.String getFilterExpression()