org.mockcentral.editor.nodes.expectation
Class ExpectationElementBuilder

java.lang.Object
  extended by org.mockcentral.editor.nodes.expectation.ExpectationElementBuilder

public class ExpectationElementBuilder
extends java.lang.Object

A class used to build a JDOM Element for a Mock Object method expectation.

Author:
David Hutchinson

Constructor Summary
ExpectationElementBuilder()
           
 
Method Summary
static org.jdom.Element createExpectationElement(ExpectationDataBean bean)
          Returns a new JDOM Element for a Mock Object method expectation.
static ExpectationModel createNewExpectationModel(MockObjectModel mockObjectModel)
          Creates and returns a new ExpectationModel.
static org.mockcentral.server.SignaturePartBean createSignaturePartBean(java.lang.Class<?> clazz, boolean deduce)
          Returns a SignaturePartBean created using the supplied Class.
static org.mockcentral.server.SignaturePartBean createSignaturePartBean(org.jdom.Element e, java.util.List<NodeProblem> nodeProblems)
          Returns a new SignaturePartBean constructed from data in the supplied Element.
static java.util.ArrayList<org.mockcentral.server.SignaturePartBean> createSignaturePartBeanList(java.util.List<java.lang.Class<?>> classes, SignaturePartElementCreationStrategy strategy)
          Returns a list of SignaturePartBean instances built from the supplied Class list using the specified SignaturePartElementCreationStrategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpectationElementBuilder

public ExpectationElementBuilder()
Method Detail

createExpectationElement

public static org.jdom.Element createExpectationElement(ExpectationDataBean bean)
Returns a new JDOM Element for a Mock Object method expectation.

Parameters:
bean - the ExpectationDataBean containing the data for building the Element.
Returns:
a new JDOM Element for a Mock Object method expectation.

createSignaturePartBean

public static org.mockcentral.server.SignaturePartBean createSignaturePartBean(org.jdom.Element e,
                                                                               java.util.List<NodeProblem> nodeProblems)
Returns a new SignaturePartBean constructed from data in the supplied Element. Any errors generated during the process will result in new NodeProblem instances being added to the supplied list.

Parameters:
e - the JDOM Element.
nodeProblems - the list for any NodeProblem instances.
Returns:
a new SignaturePartBean constructed from data in the supplied Element.

createSignaturePartBeanList

public static java.util.ArrayList<org.mockcentral.server.SignaturePartBean> createSignaturePartBeanList(java.util.List<java.lang.Class<?>> classes,
                                                                                                        SignaturePartElementCreationStrategy strategy)
Returns a list of SignaturePartBean instances built from the supplied Class list using the specified SignaturePartElementCreationStrategy.

Parameters:
classes - the list of Classes.
strategy - the SignaturePartElementCreationStrategy
Returns:
a list of SignaturePartBean instances built from the supplied Class list.

createSignaturePartBean

public static org.mockcentral.server.SignaturePartBean createSignaturePartBean(java.lang.Class<?> clazz,
                                                                               boolean deduce)
Returns a SignaturePartBean created using the supplied Class. If the deduce flag is set, various strategies will be used to set the bean's ValueType and value as necessary, based on the class. If not, the bean's ValueType will be set to null.

Parameters:
clazz - the Class.
deduce - whether to use a deduction strategy in creating the bean.
Returns:
a SignaturePartBean created using the supplied Class.

createNewExpectationModel

public static ExpectationModel createNewExpectationModel(MockObjectModel mockObjectModel)
Creates and returns a new ExpectationModel.

Parameters:
mockObjectModel - the MockObjectModel to enclose the new expectation, or null if none.
Returns:
the new ExpectationModel.