com.opensymphony.xwork2.mock
Class MockInterceptor

java.lang.Object
  extended by com.opensymphony.xwork2.mock.MockInterceptor
All Implemented Interfaces:
Interceptor, java.io.Serializable

public class MockInterceptor
extends java.lang.Object
implements Interceptor

Mock for an Interceptor.

Author:
Jason Carreira
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_FOO_VALUE
           
 
Constructor Summary
MockInterceptor()
           
 
Method Summary
 void destroy()
          Called to let an interceptor clean up any resources it has allocated.
 boolean equals(java.lang.Object o)
           
 java.lang.String getExpectedFoo()
           
 java.lang.String getFoo()
           
 int hashCode()
           
 void init()
          Called after an Interceptor is created, but before any requests are processed using the intercept() methodName.
 java.lang.String intercept(ActionInvocation invocation)
          Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
 boolean isExecuted()
           
 void setExpectedFoo(java.lang.String expectedFoo)
           
 void setFoo(java.lang.String foo)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FOO_VALUE

public static final java.lang.String DEFAULT_FOO_VALUE
See Also:
Constant Field Values
Constructor Detail

MockInterceptor

public MockInterceptor()
Method Detail

isExecuted

public boolean isExecuted()

setExpectedFoo

public void setExpectedFoo(java.lang.String expectedFoo)

getExpectedFoo

public java.lang.String getExpectedFoo()

setFoo

public void setFoo(java.lang.String foo)

getFoo

public java.lang.String getFoo()

destroy

public void destroy()
Called to let an interceptor clean up any resources it has allocated.

Specified by:
destroy in interface Interceptor

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

init

public void init()
Called after an Interceptor is created, but before any requests are processed using the intercept() methodName. This gives the Interceptor a chance to initialize any needed resources.

Specified by:
init in interface Interceptor

intercept

public java.lang.String intercept(ActionInvocation invocation)
                           throws java.lang.Exception
Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.

Specified by:
intercept in interface Interceptor
Parameters:
invocation - the action invocation
Returns:
the return code, either returned from ActionInvocation.invoke(), or from the interceptor itself.
Throws:
java.lang.Exception - any system-level error, as defined in Action.execute().


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.