Provide the parser encode and decode methods with the spark

I have a custom spark where the behaviour of my custom parser depends on the spark's status.

Currently parsers have no way to determine this.