FolderEvent (Java EE 5)

Java EE API


javax.mail.event Class FolderEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.mail.event.MailEvent
          extended by javax.mail.event.FolderEvent
All Implemented Interfaces:
Serializable

public class FolderEvent
extends MailEvent

Extends: java.util.EventObject > MailEvent

此类模拟 Folder 存在 事件。FolderEvent 被传送给 FolderListener,FolderListener 在受影响的 Folder 和包含它的 Store 上注册。

服务提供者通知客户这些事件的能力各不相同。最低限度是,服务提供者必须通知在发生操作的同一个 Store 或 Folder 对象上注册的侦听器。当更改由同一虚拟机中其他对象上的操作产生,或者由同一个主机或其他主机中的其他客户端产生时,服务提供者也可能会通知侦听器。此类通知不是必需的,通常不受邮件协议(包括 IMAP)支持。

英文文档:

This class models Folder existence events. FolderEvents are delivered to FolderListeners registered on the affected Folder as well as the containing Store.

Service providers vary widely in their ability to notify clients of these events. At a minimum, service providers must notify listeners registered on the same Store or Folder object on which the operation occurs. Service providers may also notify listeners when changes are made through operations on other objects in the same virtual machine, or by other clients in the same or other hosts. Such notifications are not required and are typically not supported by mail protocols (including IMAP).

Author:
John Mani, Bill Shannon
See Also:
Serialized Form

Field Summary
static int
static int
protected  Folder
protected  Folder
static int
protected  int
 
Fields inherited from class java.util.EventObject
 
Constructor Summary
 
Method Summary
 void
 Folder
 Folder
 int
 
Methods inherited from class java.util.EventObject
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

CREATED

public static final int CREATED
The folder was created.

See Also:
Constant Field Values


英文文档:

DELETED

public static final int DELETED
The folder was deleted.

See Also:
Constant Field Values


英文文档:

RENAMED

public static final int RENAMED
The folder was renamed.

See Also:
Constant Field Values


英文文档:

type

protected int type
The event type.


英文文档:

folder

protected transient Folder folder
The folder the event occurred on.


英文文档:

newFolder

protected transient Folder newFolder
The folder that represents the new name, in case of a RENAMED event.

Since:
JavaMail 1.1

Constructor Detail

public FolderEvent(Object source, Folder folder, int type)
构造方法。

source 事件源
folder 受影响的文件夹
type 事件类型

英文文档:

FolderEvent

public FolderEvent(Object source,
                   Folder folder,
                   int type)
Constructor.

Parameters:
source - The source of the event
folder - The affected folder
type - The event type


public FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
构造方法。用于 RENAMED 事件。
source 事件源
oldFolder 重命名的文件夹
newFolder 表示新名称的文件夹
type 事件类型
since
JavaMail 1.1
英文文档:

FolderEvent

public FolderEvent(Object source,
                   Folder oldFolder,
                   Folder newFolder,
                   int type)
Constructor. Use for RENAMED events.

Parameters:
source - The source of the event
oldFolder - The folder that is renamed
newFolder - The folder that represents the new name
type - The event type
Since:
JavaMail 1.1

Method Detail

public int getType()
返回此事件的类型。
return 类型
英文文档:

getType

public int getType()
Return the type of this event.

Returns:
type

public Folder getFolder()
返回受影响的文件夹。
return 受影响的文件夹
See also getNewFolder
英文文档:

getFolder

public Folder getFolder()
Return the affected folder.

Returns:
the affected folder
See Also:
getNewFolder()

public Folder getNewFolder()
如果此事件指示一个文件夹被重命名(即,事件类型为 RENAMED),则此方法返回表示新名称的 Folder 对象。

getFolder() 方法返回重命名的文件夹。

return 表示新名称的文件夹。
since
JavaMail 1.1
See also getFolder

英文文档:

getNewFolder

public Folder getNewFolder()
If this event indicates that a folder is renamed, (i.e, the event type is RENAMED), then this method returns the Folder object representing the new name.

The getFolder() method returns the folder that is renamed.

Returns:
Folder representing the new name.
Since:
JavaMail 1.1
See Also:
getFolder()

public void dispatch(Object listener)
调用相应的 FolderListener 方法
英文文档:

dispatch

public void dispatch(Object listener)
Invokes the appropriate FolderListener method

Specified by:
dispatch in class MailEvent


Submit a bug or feature

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

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

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