org.specrunner.context.core
Class LazyExpressionModel<T>

java.lang.Object
  extended by org.specrunner.context.core.LazyExpressionModel<T>
Type Parameters:
T - The return type.
All Implemented Interfaces:
IModel<T>

public class LazyExpressionModel<T>
extends Object
implements IModel<T>

A model with a object source. This model is evaluated only on runtime.

Author:
Thiago Santos

Field Summary
protected  Object source
          The source of expression.
 
Constructor Summary
LazyExpressionModel(Object source)
          Creates a lazy model from a source.
 
Method Summary
 T getObject(IContext context)
          Return the object.
 Object getSource()
          Gets the source.
 void setSource(Object source)
          Sets the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected Object source
The source of expression.

Constructor Detail

LazyExpressionModel

public LazyExpressionModel(Object source)
Creates a lazy model from a source.

Parameters:
source - The expression source.
Method Detail

getSource

public Object getSource()
Gets the source.

Returns:
The source.

setSource

public void setSource(Object source)
Sets the source.

Parameters:
source - The source.

getObject

public T getObject(IContext context)
            throws ContextException
Description copied from interface: IModel
Return the object.

Specified by:
getObject in interface IModel<T>
Parameters:
context - The context.
Returns:
The object model.
Throws:
ContextException


Copyright © 2014. All rights reserved.