|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opensymphony.xwork2.mock.MockContainer
public class MockContainer
Mock implementation to be used in unittests
| Field Summary |
|---|
| Fields inherited from interface com.opensymphony.xwork2.inject.Container |
|---|
DEFAULT_NAME |
| Constructor Summary | |
|---|---|
MockContainer()
|
|
| Method Summary | ||
|---|---|---|
|
getInstance(Class<T> type)
Convenience method. Equivalent to getInstance(type,
DEFAULT_NAME). |
|
|
getInstance(Class<T> type,
String name)
Gets an instance of the given dependency which was declared in ContainerBuilder. |
|
Set<String> |
getInstanceNames(Class<?> type)
Gets a set of all registered names for the given type |
|
|
inject(Class<T> implementation)
Creates and injects a new instance of type implementation. |
|
void |
inject(Object o)
Injects dependencies into the fields and methods of an existing object. |
|
void |
removeScopeStrategy()
Removes the scope strategy for the current thread. |
|
void |
setScopeStrategy(Scope.Strategy scopeStrategy)
Sets the scope strategy for the current thread. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockContainer()
| Method Detail |
|---|
public void inject(Object o)
Container
inject in interface Containerpublic <T> T inject(Class<T> implementation)
Containerimplementation.
inject in interface Container
public <T> T getInstance(Class<T> type,
String name)
ContainerContainerBuilder.
getInstance in interface Containerpublic <T> T getInstance(Class<T> type)
ContainergetInstance(type,
DEFAULT_NAME).
getInstance in interface Containerpublic Set<String> getInstanceNames(Class<?> type)
Container
getInstanceNames in interface Containertype - The instance type
public void setScopeStrategy(Scope.Strategy scopeStrategy)
Container
setScopeStrategy in interface Containerpublic void removeScopeStrategy()
Container
removeScopeStrategy in interface Container
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||