org.specrunner.source.text
Class Sentence

java.lang.Object
  extended by org.specrunner.source.text.Sentence
All Implemented Interfaces:
IValidable

public class Sentence
extends Object
implements IValidable

A valid sentence.

Author:
Thiago Santos

Constructor Summary
Sentence(String text)
          Creates a sentence with a given text.
 
Method Summary
 DataTable getData()
          Get data information.
 String getMessage()
          Get the message content.
 String getText()
          Get the sentence text.
 boolean hasData()
          check if a sentence has data table.
 boolean hasMessage()
          Check if a sentence has a message associated.
 void setData(DataTable data)
          Set the data table.
 void setMessage(String message)
          Set the message content.
 void setText(String text)
          Set the sentence text.
 String validate()
          Perform object validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sentence

public Sentence(String text)
Creates a sentence with a given text.

Parameters:
text - The text.
Method Detail

getText

public String getText()
Get the sentence text.

Returns:
The text.

setText

public void setText(String text)
Set the sentence text.

Parameters:
text - The text.

hasData

public boolean hasData()
check if a sentence has data table.

Returns:
true, if it has, false, otherwise.

getData

public DataTable getData()
Get data information.

Returns:
The data.

setData

public void setData(DataTable data)
Set the data table.

Parameters:
data - The table.

hasMessage

public boolean hasMessage()
Check if a sentence has a message associated.

Returns:
true, if it has, false, otherwise.

getMessage

public String getMessage()
Get the message content.

Returns:
The message.

setMessage

public void setMessage(String message)
Set the message content.

Parameters:
message - The message.

validate

public String validate()
Description copied from interface: IValidable
Perform object validation.

Specified by:
validate in interface IValidable
Returns:
The description of errors, if any, empty string otherwise.


Copyright © 2015. All rights reserved.