SearchTerm (Java EE 5)

Java EE API


javax.mail.search Class SearchTerm

java.lang.Object
  extended by javax.mail.search.SearchTerm
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AddressTerm, AndTerm, ComparisonTerm, FlagTerm, NotTerm, OrTerm, StringTerm

public abstract class SearchTerm
extends Object
implements Serializable

Implements: java.io.Serializable

搜索条件被表示为一个搜索条目树,形成搜索表达式的解析树。

搜索条目由此类表示。这是一个抽象类;子类实现具体的匹配方法。

搜索条目是可序列化的,这允许在会话之间存储搜索条目。 警告:此类的序列化对象可能与以后的 JavaMail API 版本不兼容。当前的序列化支持适用于短期存储。

警告:在 JDK 1.1 系统上,包含引用 Message.RecipientType 类型对象的搜索条目将无法正常反序列化。虽然无需抛出任何异常就可以对这些对象进行反序列化,但是生成的对象不符合 Message.RecipientType 类的类型安全枚举 协定。对这些对象进行适当的反序列化依赖于对 readReplace 方法的支持,该方法已经添加到 JDK 1.2 中。

英文文档:

Search criteria are expressed as a tree of search-terms, forming a parse-tree for the search expression.

Search-terms are represented by this class. This is an abstract class; subclasses implement specific match methods.

Search terms are serializable, which allows storing a search term between sessions. Warning: Serialized objects of this class may not be compatible with future JavaMail API releases. The current serialization support is appropriate for short term storage.

Warning: Search terms that include references to objects of type Message.RecipientType will not be deserialized correctly on JDK 1.1 systems. While these objects will be deserialized without throwing any exceptions, the resulting objects violate the type-safe enum contract of the Message.RecipientType class. Proper deserialization of these objects depends on support for the readReplace method, added in JDK 1.2.

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

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

Constructor Detail

public SearchTerm()
英文文档:

SearchTerm

public SearchTerm()
Method Detail

abstract public boolean match(Message msg)
此方法对给定消息应用特定匹配条件,并返回结果。
msg 匹配条件将应用于此消息
return 如果匹配成功,则返回 true;匹配失败则返回 false。
英文文档:

match

public abstract boolean match(Message msg)
This method applies a specific match criterion to the given message and returns the result.

Parameters:
msg - The match criterion is applied on this message
Returns:
true, it the match succeeds, false if the match fails


Submit a bug or feature

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

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

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