FacesEvent (Java EE 5)

Java EE API


javax.faces.event Class FacesEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.faces.event.FacesEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActionEvent, ValueChangeEvent

public abstract class FacesEvent
extends EventObject

Extends: java.util.EventObject

FacesEvent 是可以由 UIComponent 激发的用户界面和应用程序事件的基类。具体的事件类必须子类化 FacesEvent 才能受到请求处理生命周期的支持。

英文文档:

FacesEvent is the base class for user interface and application events that can be fired by UIComponents. Concrete event classes must subclass FacesEvent in order to be supported by the request processing lifecycle.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
 
Constructor Summary
 
Method Summary
 UIComponent
 PhaseId
abstract  boolean
abstract  void
 void
 void
 
Methods inherited from class java.util.EventObject
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public FacesEvent(UIComponent component)

根据指定的源组件构造一个新的事件对象。

component 此事件的源 UIComponent
ThrowsIllegalArgumentException: 如果 componentnull
英文文档:

FacesEvent

public FacesEvent(UIComponent component)

Construct a new event object from the specified source component.

Parameters:
component - Source UIComponent for this event
Throws:
IllegalArgumentException - if component is null

Method Detail

public UIComponent getComponent()

返回发送此事件的源 UIComponent

英文文档:

getComponent

public UIComponent getComponent()

Return the source UIComponent that sent this event.


public PhaseId getPhaseId()

返回传送此事件的请求处理阶段的标识符。合法值是由 PhaseId 类定义的单件实例,包括默认值 PhaseId.ANY_PHASE

英文文档:

getPhaseId

public PhaseId getPhaseId()

Return the identifier of the request processing phase during which this event should be delivered. Legal values are the singleton instances defined by the PhaseId class, including PhaseId.ANY_PHASE, which is the default value.


public void setPhaseId(PhaseId phaseId)

设置传送此事件的 PhaseId

ThrowsIllegalArgumentException: phaseId 为 null。
英文文档:

setPhaseId

public void setPhaseId(PhaseId phaseId)

Set the PhaseId during which this event will be delivered.

Throws:
IllegalArgumentException - phaseId is null.

public void queue()

使此事件加入队列以便在当前请求处理生命周期阶段结束时进行广播的便捷方法。

ThrowsIllegalStateException: 如果此事件的源组件不是 UIViewRoot 的后代。
英文文档:

queue

public void queue()

Convenience method to queue this event for broadcast at the end of the current request processing lifecycle phase.

Throws:
IllegalStateException - if the source component for this event is not a descendant of a UIViewRoot

abstract public boolean isAppropriateListener(FacesListener listener)

如果此 FacesListener 是此事件支持的侦听器类的一个实例,则返回 true。通常,这将对侦听器类进行 "instanceof" 检查。

listener 要求值的 FacesListener
英文文档:

isAppropriateListener

public abstract boolean isAppropriateListener(FacesListener listener)

Return true if this FacesListener is an instance of a listener class that this event supports. Typically, this will be accomplished by an "instanceof" check on the listener class.

Parameters:
listener - FacesListener to evaluate

abstract public void processListener(FacesListener listener)

按照适用的机制,将此 FacesEvent 广播到指定的 FacesListener。通常,这将调用一个事件处理方法,并将此 FacesEvent 作为参数传递。

listener 接收此 FacesEventFacesListener
ThrowsAbortProcessingException: 通知 JavaServer Face 实现不应该继续处理当前事件
英文文档:

processListener

public abstract void processListener(FacesListener listener)

Broadcast this FacesEvent to the specified FacesListener, by whatever mechanism is appropriate. Typically, this will be accomplished by calling an event processing method, and passing this FacesEvent as a paramter.

Parameters:
listener - FacesListener to send this FacesEvent to
Throws:
AbortProcessingException - Signal the JavaServer Faces implementation that no further processing on the current event should be performed


Submit a bug or feature

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

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

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