gherkin.formatter
Class PrettyFormatter

java.lang.Object
  extended by gherkin.formatter.PrettyFormatter
All Implemented Interfaces:
Formatter, Reporter, Closeable

public class PrettyFormatter
extends Object
implements Reporter, Formatter

This class pretty prints feature files like they were in the source, only prettier. That is, with consistent indentation. This class is also a Reporter, which means it can be used to print execution results - highlighting arguments, printing source information and exception information.


Constructor Summary
PrettyFormatter(Appendable out, boolean monochrome, boolean executing)
           
 
Method Summary
 void after(Match match, Result result)
           
 void background(Background background)
           
 void before(Match match, Result result)
           
 void close()
          Closes all underlying streams.
 void docString(DocString docString)
           
 void done()
          Indicates that the last file has been processed.
 void embedding(String mimeType, byte[] data)
           
 void eof()
          Indicates the End-Of-File for a Gherkin document (.feature file)
 void examples(Examples examples)
           
 void feature(Feature feature)
           
 void match(Match match)
           
 void nextRow()
           
 void result(Result result)
           
 void row(List<CellResult> cellResults)
           
 void scenario(Scenario scenario)
           
 void scenarioOutline(ScenarioOutline scenarioOutline)
           
 void setMonochrome(boolean monochrome)
           
 void step(Step step)
           
 void syntaxError(String state, String event, List<String> legalEvents, String uri, Integer line)
           
 void table(List<? extends Row> rows)
           
 void uri(String uri)
           
 void write(String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyFormatter

public PrettyFormatter(Appendable out,
                       boolean monochrome,
                       boolean executing)
Method Detail

setMonochrome

public void setMonochrome(boolean monochrome)

uri

public void uri(String uri)
Specified by:
uri in interface Formatter

feature

public void feature(Feature feature)
Specified by:
feature in interface Formatter

background

public void background(Background background)
Specified by:
background in interface Formatter

scenario

public void scenario(Scenario scenario)
Specified by:
scenario in interface Formatter

scenarioOutline

public void scenarioOutline(ScenarioOutline scenarioOutline)
Specified by:
scenarioOutline in interface Formatter

examples

public void examples(Examples examples)
Specified by:
examples in interface Formatter

step

public void step(Step step)
Specified by:
step in interface Formatter

match

public void match(Match match)
Specified by:
match in interface Reporter

embedding

public void embedding(String mimeType,
                      byte[] data)
Specified by:
embedding in interface Reporter

write

public void write(String text)
Specified by:
write in interface Reporter

result

public void result(Result result)
Specified by:
result in interface Reporter

before

public void before(Match match,
                   Result result)
Specified by:
before in interface Reporter

after

public void after(Match match,
                  Result result)
Specified by:
after in interface Reporter

table

public void table(List<? extends Row> rows)

row

public void row(List<CellResult> cellResults)

nextRow

public void nextRow()

syntaxError

public void syntaxError(String state,
                        String event,
                        List<String> legalEvents,
                        String uri,
                        Integer line)
Specified by:
syntaxError in interface Formatter

done

public void done()
Description copied from interface: Formatter
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.

Specified by:
done in interface Formatter

close

public void close()
Description copied from interface: Formatter
Closes all underlying streams.

Specified by:
close in interface Formatter
Specified by:
close in interface Closeable

docString

public void docString(DocString docString)

eof

public void eof()
Description copied from interface: Formatter
Indicates the End-Of-File for a Gherkin document (.feature file)

Specified by:
eof in interface Formatter


Copyright © 2012. All Rights Reserved.