grendel.mime
Interface IMimeOperator


public abstract interface IMimeOperator

This is the interface of objects which operate on a parsed tree of MIME objects. When an IMimeParser is created to parse a stream, an implementor of IMimeOperator is created along with it, to operate on the MIME objects as they are parsed. Each IMimeOperator has an IMimeObject associated with it, representing the node currently being parsed. It may use that to interrogate information like content-types and other header values.

See Also:
MimeHTMLOperatorFactory, IMimeObject, IMimeParser

Method Summary
 IMimeOperator createChild(IMimeObject object)
          If the MimeObject is not a leaf node, this method will be called each time a new child object is seen.
 void pushBytes(ByteBuf b)
          If the MimeObject is a leaf node, this method is called with the bytes of the body.
 void pushEOF()
          This method is called when the end of the MimeObject's body has been seen.
 

Method Detail

pushBytes

public void pushBytes(ByteBuf b)
If the MimeObject is a leaf node, this method is called with the bytes of the body. It may be called any number of times, including 0, and the blocks will not necessarily fall on line boundaries.

createChild

public IMimeOperator createChild(IMimeObject object)
If the MimeObject is not a leaf node, this method will be called each time a new child object is seen. It should create and return a corresponding MimeOperator (which may or may not be of the same type as `this'.)

pushEOF

public void pushEOF()
This method is called when the end of the MimeObject's body has been seen. It is called exactly once, and is called both for leaf and non-leaf MIME objects. Neither pushBytes() nor createChild() will be called after pushEOF().