ApplicationFactory (Java EE 5)

Java EE API


javax.faces.application Class ApplicationFactory

java.lang.Object
  extended by javax.faces.application.ApplicationFactory

public abstract class ApplicationFactory
extends Object


ApplicationFactory 是创建(如果需要)并返回 Application 实例的工厂对象。JavaServer Faces 的实现必须至少提供一个 Application 的默认实现。

使用 JavaServer Faces 的每个 Web 应用程序都必须有一个 ApplicationFactory 实例。可以通过可移植的方式获取此实例,即调用:

ApplicationFactory factory = (ApplicationFactory)
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
 
英文文档:

ApplicationFactory is a factory object that creates (if needed) and returns Application instances. Implementations of JavaServer Faces must provide at least a default implementation of Application.

There must be one ApplicationFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

   ApplicationFactory factory = (ApplicationFactory)
    FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
 


Constructor Summary
 
Method Summary
abstract  Application
abstract  void
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public ApplicationFactory()
英文文档:

ApplicationFactory

public ApplicationFactory()
Method Detail

abstract public Application getApplication()

创建(如果需要)并返回此 Web 应用程序的 Application 实例。

英文文档:

getApplication

public abstract Application getApplication()

Create (if needed) and return an Application instance for this web application.


abstract public void setApplication(Application application)

替换将为此 Web 应用程序返回的 Application 实例。

ThrowsNullPointerException: 如果 applicationnull
application 替换 Application 实例
英文文档:

setApplication

public abstract void setApplication(Application application)

Replace the Application instance that will be returned for this web application.

Parameters:
application - The replacement Application instance
Throws:
NullPointerException - if application is null.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!