com.appfoundation.automation.framework.gwen.business
Class SentenceAssembler

java.lang.Object
  extended by com.appfoundation.automation.framework.gwen.business.SentenceAssembler

public class SentenceAssembler
extends java.lang.Object

SentenceAssembler

The purpose of this class is take a File input of raw text, and convert each line to a Sentence. A Sentence is an array of Elements, which are strings that can either be a word, or a grouping of words encapsulated by quotes.

Author:
john.valentino

Constructor Summary
SentenceAssembler()
           
 
Method Summary
protected  Variable determineVariable(java.lang.String line, int lineNumber)
           
protected  java.util.Map<java.lang.String,Variable> findVariables(java.util.List<java.lang.String> lines)
           
protected  java.util.List<java.lang.String> lineToListOfElements(java.lang.String line)
          Takes a string and makes it into an array of elements, where words in quotes are counted a a single element.
 SentenceFile process(java.lang.String fileName, java.io.File input)
          Reads the input file and produces a Sentence File.
 SentenceFile process(java.lang.String fileName, java.util.List<java.lang.String> lines)
           
 Sentence toSentence(java.lang.String line, int lineNumber)
          Creating a Sentence using the given String, and notes the line number.
 Sentence toSentence(java.lang.String line, int lineNumber, java.util.Map<java.lang.String,Variable> variables)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SentenceAssembler

public SentenceAssembler()
Method Detail

process

public SentenceFile process(java.lang.String fileName,
                            java.io.File input)
                     throws java.lang.Exception
Reads the input file and produces a Sentence File.

Parameters:
input -
Returns:
Throws:
java.lang.Exception

process

public SentenceFile process(java.lang.String fileName,
                            java.util.List<java.lang.String> lines)
                     throws java.lang.Exception
Throws:
java.lang.Exception

findVariables

protected java.util.Map<java.lang.String,Variable> findVariables(java.util.List<java.lang.String> lines)
                                                          throws java.lang.Exception
Throws:
java.lang.Exception

determineVariable

protected Variable determineVariable(java.lang.String line,
                                     int lineNumber)
                              throws java.lang.Exception
Throws:
java.lang.Exception

toSentence

public Sentence toSentence(java.lang.String line,
                           int lineNumber)
Creating a Sentence using the given String, and notes the line number.

Parameters:
line -
lineNumber -
Returns:

toSentence

public Sentence toSentence(java.lang.String line,
                           int lineNumber,
                           java.util.Map<java.lang.String,Variable> variables)

lineToListOfElements

protected java.util.List<java.lang.String> lineToListOfElements(java.lang.String line)
Takes a string and makes it into an array of elements, where words in quotes are counted a a single element.

Parameters:
line -
Returns: