org.specrunner.source.text
Class FeatureReaderImpl

java.lang.Object
  extended by org.specrunner.source.text.FeatureReaderImpl
All Implemented Interfaces:
IFeatureReader

public class FeatureReaderImpl
extends Object
implements IFeatureReader

Basic implementation of reature reader.

Author:
Thiago Santos

Field Summary
protected static ICache<String,Keywords> cacheKeywords
          The keyword set.
 
Constructor Summary
FeatureReaderImpl()
           
 
Method Summary
 Feature load(InputStream in, String encoding)
          Read feature from load.
protected  void readExamples(BufferedReader reader, String line, ScenarioOutline outline)
          Read examples.
protected  void readFeatureDescription(BufferedReader reader, String line, Keywords words, Feature feature)
          Read feature description.
protected  void readKeyword(BufferedReader reader, String line, String keyword, NamedSentences named)
          Read a keyword.
protected  String readNextGroup(BufferedReader reader, String line, List<Sentence> group)
          Read next group.
protected  String readTable(BufferedReader reader, String line, DataTable table)
          Read a data table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheKeywords

protected static ICache<String,Keywords> cacheKeywords
The keyword set.

Constructor Detail

FeatureReaderImpl

public FeatureReaderImpl()
Method Detail

load

public Feature load(InputStream in,
                    String encoding)
             throws IOException
Description copied from interface: IFeatureReader
Read feature from load.

Specified by:
load in interface IFeatureReader
Parameters:
in - The input stream.
encoding - The encoding.
Returns:
The feature.
Throws:
IOException - On reading errors.

readKeyword

protected void readKeyword(BufferedReader reader,
                           String line,
                           String keyword,
                           NamedSentences named)
                    throws IOException
Read a keyword.

Parameters:
reader - The input.
line - Current line.
keyword - The word.
named - The description object.
Throws:
IOException - On reading error.

readFeatureDescription

protected void readFeatureDescription(BufferedReader reader,
                                      String line,
                                      Keywords words,
                                      Feature feature)
                               throws IOException
Read feature description.

Parameters:
reader - The reader.
line - The line.
words - The word map.
feature - The feature.
Throws:
IOException - On reading error.

readNextGroup

protected String readNextGroup(BufferedReader reader,
                               String line,
                               List<Sentence> group)
                        throws IOException
Read next group.

Parameters:
reader - The reader.
line - The current line.
group - The group to add lines.
Returns:
The next line right after ending.
Throws:
IOException - On reading errors.

readExamples

protected void readExamples(BufferedReader reader,
                            String line,
                            ScenarioOutline outline)
                     throws IOException
Read examples.

Parameters:
reader - The reader.
line - The input line.
outline - The parent scenario.
Throws:
IOException - On reading errors.

readTable

protected String readTable(BufferedReader reader,
                           String line,
                           DataTable table)
                    throws IOException
Read a data table.

Parameters:
reader - The reader.
line - The current line.
table - The target table.
Returns:
The line just after the table.
Throws:
IOException - On reading errors.


Copyright © 2015. All rights reserved.