org.seasar.framework.aop.interceptors
クラス MockInterceptor

java.lang.Object
  拡張org.seasar.framework.aop.interceptors.AbstractInterceptor
      拡張org.seasar.framework.aop.interceptors.MockInterceptor
すべての実装インタフェース:
Advice, Interceptor, MethodInterceptor, java.io.Serializable

public class MockInterceptor
extends AbstractInterceptor

モック用のMethodInterceptorです。

作成者:
higa
関連項目:
直列化された形式

コンストラクタの概要
MockInterceptor()
          MockInterceptorを作成します。
MockInterceptor(java.lang.Object value)
          MockInterceptorを作成します。
 
メソッドの概要
 java.lang.Object[] getArgs(java.lang.String methodName)
          呼び出されたメソッドの引数を返します。
 java.lang.Object invoke(MethodInvocation invocation)
           
 boolean isInvoked(java.lang.String methodName)
          メソッドが呼び出されたどうかを返します。
 void setReturnValue(java.lang.Object returnValue)
          デフォルトの戻り値を設定します。
 void setReturnValue(java.lang.String methodName, java.lang.Object returnValue)
          指定したメソッドに対する戻り値を設定します。
 void setThrowable(java.lang.String methodName, java.lang.Throwable throwable)
          指定したメソッドを呼び出したときに、 スローされる例外を設定します。
 void setThrowable(java.lang.Throwable throwable)
          デフォルトでスローされる例外を設定します。
 
クラス org.seasar.framework.aop.interceptors.AbstractInterceptor から継承したメソッド
createProxy, getComponentDef, getTargetClass
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

MockInterceptor

public MockInterceptor()
MockInterceptorを作成します。


MockInterceptor

public MockInterceptor(java.lang.Object value)
MockInterceptorを作成します。

パラメータ:
value -
メソッドの詳細

setReturnValue

public void setReturnValue(java.lang.Object returnValue)
デフォルトの戻り値を設定します。

パラメータ:
returnValue -

setReturnValue

public void setReturnValue(java.lang.String methodName,
                           java.lang.Object returnValue)
指定したメソッドに対する戻り値を設定します。

パラメータ:
methodName -
returnValue -

setThrowable

public void setThrowable(java.lang.Throwable throwable)
デフォルトでスローされる例外を設定します。

パラメータ:
throwable -

setThrowable

public void setThrowable(java.lang.String methodName,
                         java.lang.Throwable throwable)
指定したメソッドを呼び出したときに、 スローされる例外を設定します。

パラメータ:
methodName -
throwable -

isInvoked

public boolean isInvoked(java.lang.String methodName)
メソッドが呼び出されたどうかを返します。

パラメータ:
methodName -
戻り値:

getArgs

public java.lang.Object[] getArgs(java.lang.String methodName)
呼び出されたメソッドの引数を返します。

パラメータ:
methodName -
戻り値:

invoke

public java.lang.Object invoke(MethodInvocation invocation)
                        throws java.lang.Throwable
例外:
java.lang.Throwable
関連項目:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)


Copyright © 2004-2014 The Seasar Foundation. All Rights Reserved.