org.jbehave.core.model
Class ExamplesTable

java.lang.Object
  extended by org.jbehave.core.model.ExamplesTable

public class ExamplesTable
extends Object

Represents a tabular structure to hold example data for parameters named via the headers:

 |header 1|header 2| .... |header n|
 |value 11|value 12| .... |value 1n|
 ...
 |value m1|value m2| .... |value mn|
 

Different header and value column separators can be specified to replace the default separator "|":

 !!header 1!!header 2!! .... !!header n!!
 !value 11!value 12! .... !value 1n!
 ...
 !value m1!value m2| .... !value mn!
 

Rows starting with an ignorable separator are allowed and ignored:

 |header 1|header 2| .... |header n|
 |-- A commented row --|
 |value 11|value 12| .... |value 1n|
 ...
 |-- Another commented row --|
 |value m1|value m2| .... |value mn|
 

Ignorable separator is configurable and defaults to "|--".


Constructor Summary
ExamplesTable(String tableAsString)
           
ExamplesTable(String tableAsString, String headerSeparator, String valueSeparator)
           
ExamplesTable(String tableAsString, String headerSeparator, String valueSeparator, String ignorableSeparator)
           
 
Method Summary
 String asString()
           
 List<String> getHeaders()
           
 String getHeaderSeparator()
           
 Map<String,String> getRow(int row)
           
 int getRowCount()
           
 List<Map<String,String>> getRows()
           
 String getValueSeparator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExamplesTable

public ExamplesTable(String tableAsString)

ExamplesTable

public ExamplesTable(String tableAsString,
                     String headerSeparator,
                     String valueSeparator)

ExamplesTable

public ExamplesTable(String tableAsString,
                     String headerSeparator,
                     String valueSeparator,
                     String ignorableSeparator)
Method Detail

getHeaders

public List<String> getHeaders()

getRow

public Map<String,String> getRow(int row)

getRowCount

public int getRowCount()

getRows

public List<Map<String,String>> getRows()

getHeaderSeparator

public String getHeaderSeparator()

getValueSeparator

public String getValueSeparator()

asString

public String asString()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2010. All Rights Reserved.