FolderEvent (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


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
所有已实现的接口:
Serializable

public class FolderEvent
extends MailEvent

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).

作者:
John Mani, Bill Shannon
另请参见:
Serialized Form

字段摘要
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
 
构造器摘要
FolderEvent(Object source, Folder oldFolder, Folder newFolder, int type)
          Constructor.
FolderEvent(Object source, Folder folder, int type)
          Constructor.
 
方法摘要
 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.
 
类方法继承 java.util.EventObject
getSource, toString
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

CREATED

public static final int CREATED
The folder was created.

另请参见:
常量字段


DELETED

public static final int DELETED
The folder was deleted.

另请参见:
常量字段


RENAMED

public static final int RENAMED
The folder was renamed.

另请参见:
常量字段


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.

从以下版本开始:
JavaMail 1.1

构造器详细信息

FolderEvent

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

参数:
source - The source of the event
folder - The affected folder
type - The event type


FolderEvent

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

参数:
source - The source of the event
oldFolder - The folder that is renamed
newFolder - The folder that represents the new name
type - The event type
从以下版本开始:
JavaMail 1.1

方法详细信息

getType

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

返回:
type

getFolder

public Folder getFolder()
Return the affected folder.

返回:
the affected folder
另请参见:
getNewFolder()

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.

返回:
Folder representing the new name.
从以下版本开始:
JavaMail 1.1
另请参见:
getFolder()

dispatch

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

规范说明:
dispatch in class MailEvent

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.