DefaultResultStub (jMock API Documentation)
Keywords: org.jmock.core.stub.DefaultResultStub class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jmock.core.stub
Class DefaultResultStub

    java.lang.Object
      org.jmock.core.stub.DefaultResultStub

All Implemented Interfaces:
  SelfDescribing, Stub

    public class DefaultResultStub

extends Object
implements Stub

Constructor Summary
`DefaultResultStub()`

Method Summary
`void` | `addResult(Class resultType, Object resultValue)`
`protected void` | `createDefaultResults()`
`String` | `createErrorMessage(Invocation call)`
`StringBuffer` | `describeTo(StringBuffer buf)` Appends the description of this object to the buffer.
`Object` | `invoke(Invocation invocation)` Processes the invocation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultResultStub

    public DefaultResultStub()

Method Detail

### describeTo

    public StringBuffer describeTo(StringBuffer buf)

  Description copied from interface: `SelfDescribing`
  Appends the description of this object to the buffer.

  Specified by:
    `describeTo` in interface `SelfDescribing`
  Parameters:
    `buf` - The buffer that the description is appended to.
  Returns:
    The buffer passed to the invokedMethod.

### addResult

    public void addResult(Class resultType,
                          Object resultValue)

### invoke

    public Object invoke(Invocation invocation)
                  throws Throwable

  Description copied from interface: `Stub`
  Processes the invocation.

  Specified by:
    `invoke` in interface `Stub`
  Parameters:
    `invocation` - The invocation to stub.
  Returns:
    The result of the invocation, if not throwing an exception. Must return `null` if the invocation is of a invokedMethod with a void return type.
  Throws:
    `Throwable` - An exception to be thrown to the caller, if not returning a value. A checked exception thrown from this invokedMethod must be in the `throws` list of the invoked method.

### createErrorMessage

    public String createErrorMessage(Invocation call)

### createDefaultResults

    protected void createDefaultResults()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD