Save This Page
Home » xwork-2.1.1-src » com.opensymphony.xwork2 » [javadoc | source]
com.opensymphony.xwork2
public class: ObjectFactory [javadoc | source]
java.lang.Object
   com.opensymphony.xwork2.ObjectFactory

All Implemented Interfaces:
    Serializable

Direct Known Subclasses:
    SpringObjectFactory, SpringProxyableObjectFactory

ObjectFactory is responsible for building the core framework objects. Users may register their own implementation of the ObjectFactory to control instantiation of these Objects.

This default implementation uses the buildBean method to create all classes (interceptors, actions, results, etc).

Nested Class Summary:
static class  ObjectFactory.ContinuationsClassLoader   
Field Summary
protected  ReflectionProvider reflectionProvider     
Constructor:
 public ObjectFactory() 
 public ObjectFactory(ReflectionProvider prov) 
Method from com.opensymphony.xwork2.ObjectFactory Summary:
buildAction,   buildBean,   buildBean,   buildBean,   buildInterceptor,   buildResult,   buildValidator,   getClassInstance,   getObjectFactory,   injectInternalBeans,   isNoArgConstructorRequired,   setClassLoader,   setContainer,   setReflectionProvider
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.xwork2.ObjectFactory Detail:
 public Object buildAction(String actionName,
    String namespace,
    ActionConfig config,
    Map extraContext) throws Exception 
    Build an instance of the action class to handle a particular request (eg. web request)
 public Object buildBean(Class clazz,
    Map extraContext) throws Exception 
    Build a generic Java object of the given type.
 public Object buildBean(String className,
    Map extraContext) throws Exception 
    Build a generic Java object of the given type.
 public Object buildBean(String className,
    Map extraContext,
    boolean injectInternal) throws Exception 
    Build a generic Java object of the given type.
 public Interceptor buildInterceptor(InterceptorConfig interceptorConfig,
    Map interceptorRefParams) throws ConfigurationException 
    Builds an Interceptor from the InterceptorConfig and the Map of parameters from the interceptor reference. Implementations of this method should ensure that the Interceptor is parameterized with both the parameters from the Interceptor config and the interceptor ref Map (the interceptor ref params take precedence), and that the Interceptor.init() method is called on the Interceptor instance before it is returned.
 public Result buildResult(ResultConfig resultConfig,
    Map extraContext) throws Exception 
    Build a Result using the type in the ResultConfig and set the parameters in the ResultConfig.
 public Validator buildValidator(String className,
    Map params,
    Map extraContext) throws Exception 
    Build a Validator of the given type and set the parameters on it
 public Class getClassInstance(String className) throws ClassNotFoundException 
    Utility method to obtain the class matched to className. Caches look ups so that subsequent lookups will be faster.
 public static ObjectFactory getObjectFactory() 
Deprecated! Since - 2.1

 protected Object injectInternalBeans(Object obj) 
 public boolean isNoArgConstructorRequired() 
    Allows for ObjectFactory implementations that support Actions without no-arg constructors.
 public  void setClassLoader(ClassLoader cl) 
 public  void setContainer(Container container) 
 public  void setReflectionProvider(ReflectionProvider prov)