|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.mail.event Class FolderEvent
java.lang.Object java.util.EventObject javax.mail.event.MailEvent javax.mail.event.FolderEvent
- All Implemented Interfaces:
- Serializable
public class FolderEvent
- extends 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 |
CREATED
The folder was created. |
static int |
DELETED
The folder was deleted. |
protected Folder |
folder
The folder the event occurred on. |
protected Folder |
newFolder
The folder that represents the new name, in case of a RENAMED event. |
static int |
RENAMED
The folder was renamed. |
protected int |
type
The event type. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
FolderEvent(Object source,
Folder oldFolder,
Folder newFolder,
int type)
Constructor. |
|
FolderEvent(Object source,
Folder folder,
int type)
Constructor. |
Method Summary | |
---|---|
void |
dispatch(Object listener)
Invokes the appropriate FolderListener method |
Folder |
getFolder()
Return the affected folder. |
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. |
int |
getType()
Return the type of this event. |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 eventfolder
- The affected foldertype
- The event type
public
FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
构造方法。用于 RENAMED 事件。
source | 事件源 | |
oldFolder | 重命名的文件夹 | |
newFolder | 表示新名称的文件夹 | |
type | 事件类型 | |
since |
|
FolderEvent
public FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
- Constructor. Use for RENAMED events.
- Parameters:
source
- The source of the eventoldFolder
- The folder that is renamednewFolder
- The folder that represents the new nametype
- 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 |
| |
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!