com.opensymphony.xwork2.inject
Class ExternalContext<T>

java.lang.Object
  extended by com.opensymphony.xwork2.inject.ExternalContext<T>
All Implemented Interfaces:
Context

 class ExternalContext<T>
extends Object
implements Context

An immutable snapshot of the current context which is safe to expose to client code.

Author:
crazybob@google.com (Bob Lee)

Field Summary
(package private)  ContainerImpl container
           
(package private)  Key<T> key
           
(package private)  Member member
           
 
Constructor Summary
ExternalContext(Member member, Key<T> key, ContainerImpl container)
           
 
Method Summary
 Container getContainer()
          Gets the Container.
 Member getMember()
          Gets the field, method or constructor which is being injected.
 String getName()
          Gets the name of the injection specified by Inject.value().
 Scope.Strategy getScopeStrategy()
          Gets the current scope strategy.
 Class<T> getType()
          Gets the type of the field or parameter which is being injected.
(package private) static
<T> ExternalContext<T>
newInstance(Member member, Key<T> key, ContainerImpl container)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

member

final Member member

key

final Key<T> key

container

final ContainerImpl container
Constructor Detail

ExternalContext

public ExternalContext(Member member,
                       Key<T> key,
                       ContainerImpl container)
Method Detail

getType

public Class<T> getType()
Description copied from interface: Context
Gets the type of the field or parameter which is being injected.

Specified by:
getType in interface Context

getScopeStrategy

public Scope.Strategy getScopeStrategy()
Description copied from interface: Context
Gets the current scope strategy. See Container.setScopeStrategy(Scope.Strategy).

Specified by:
getScopeStrategy in interface Context

getContainer

public Container getContainer()
Description copied from interface: Context
Gets the Container.

Specified by:
getContainer in interface Context

getMember

public Member getMember()
Description copied from interface: Context
Gets the field, method or constructor which is being injected. Returns null if the object currently being constructed is pre-loaded as a singleton or requested from Container.getInstance(Class).

Specified by:
getMember in interface Context

getName

public String getName()
Description copied from interface: Context
Gets the name of the injection specified by Inject.value().

Specified by:
getName in interface Context

toString

public String toString()
Overrides:
toString in class Object

newInstance

static <T> ExternalContext<T> newInstance(Member member,
                                          Key<T> key,
                                          ContainerImpl container)


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