gherkin.formatter
Interface Formatter

All Superinterfaces:
Closeable
All Known Implementing Classes:
FilterFormatter, JSONFormatter, JSONPrettyFormatter, PrettyFormatter

public interface Formatter
extends Closeable

This is the interface you should implement if you want your own custom formatter.


Method Summary
 void background(Background background)
          Called before the actual execution of the background step container.
 void close()
          Closes all underlying streams.
 void done()
          Indicates that the last file has been processed.
 void endOfScenarioLifeCycle(Scenario scenario)
          Is called at the end of the scenario life cycle, meaning after the last "after" hook.
 void eof()
          Indicates the End-Of-File for a Gherkin document (.feature file)
 void examples(Examples examples)
          Called before the actual execution of the scenario examples.
 void feature(Feature feature)
          Called after the uri(String), but before the actual feature execution.
 void scenario(Scenario scenario)
          Called before the actual execution of the scenario step container.
 void scenarioOutline(ScenarioOutline scenarioOutline)
          Called before the actual execution of the scenario outline step container.
 void startOfScenarioLifeCycle(Scenario scenario)
          Is called at the beginning of the scenario life cycle, meaning before the first "before" hook.
 void step(Step step)
          Is called for each step of a step container.
 void syntaxError(String state, String event, List<String> legalEvents, String uri, Integer line)
          Is called in case any syntax error was detected during the parsing of the feature files.
 void uri(String uri)
          Called at the beginning of each feature.
 

Method Detail

syntaxError

void syntaxError(String state,
                 String event,
                 List<String> legalEvents,
                 String uri,
                 Integer line)
Is called in case any syntax error was detected during the parsing of the feature files.

Parameters:
state - the current state of the parser machine
event - detected event
legalEvents - expected event
uri - the URI of the feature file
line - the line number of the event

uri

void uri(String uri)
Called at the beginning of each feature.

Parameters:
uri - the feature's URI

feature

void feature(Feature feature)
Called after the uri(String), but before the actual feature execution.

Parameters:
feature - the to be executed Feature

scenarioOutline

void scenarioOutline(ScenarioOutline scenarioOutline)
Called before the actual execution of the scenario outline step container.

Parameters:
scenarioOutline - the to be executed ScenarioOutline

examples

void examples(Examples examples)
Called before the actual execution of the scenario examples. This is called after the scenarioOutline(gherkin.formatter.model.ScenarioOutline), but before any actual scenario example.

Parameters:
examples - the to be executed

startOfScenarioLifeCycle

void startOfScenarioLifeCycle(Scenario scenario)
Is called at the beginning of the scenario life cycle, meaning before the first "before" hook.

Parameters:
scenario - the Scenario of the current lifecycle

background

void background(Background background)
Called before the actual execution of the background step container.

Parameters:
background - the to be executed Background

scenario

void scenario(Scenario scenario)
Called before the actual execution of the scenario step container.

Parameters:
scenario - the to be executed Scenario

step

void step(Step step)
Is called for each step of a step container. Attention: All steps are iterated through this method before any step is actually executed.

Parameters:
step - the Step to be executed

endOfScenarioLifeCycle

void endOfScenarioLifeCycle(Scenario scenario)
Is called at the end of the scenario life cycle, meaning after the last "after" hook. * @param scenario the Scenario of the current lifecycle


done

void done()
Indicates that the last file has been processed. This should print out any closing output, such as completing the JSON string, but it should *not* close any underlying streams/writers.


close

void close()
Closes all underlying streams.

Specified by:
close in interface Closeable

eof

void eof()
Indicates the End-Of-File for a Gherkin document (.feature file)



Copyright © 2013. All rights reserved.