Top Description Fields Constructors Methods
javax.mail.search

public final Class BodyTerm

extends StringTerm
Class Inheritance
Imports
java.io.IOException, javax.mail.*

This class implements searches on a message body. All parts of the message that are of MIME type "text/*" are searched. The pattern is a simple string that must appear as a substring in the message body.
Authors
Bill Shannon, John Mani

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from javax.mail.search.StringTerm:
ignoreCasepattern

Constructor Summary

AccessConstructor and Description
public
BodyTerm(String
The String to search for
pattern
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides javax.mail.search.StringTerm.equals.

Equality comparison.
public boolean

Returns:

true if the pattern is found; otherwise false
match
(Message
The pattern search is applied on this Message's body
msg
)

Implements abstract javax.mail.search.SearchTerm.match.

The match method.
private boolean
matchPart(Part p)

Search all the parts of the message for any text part that matches the pattern.

Inherited from javax.mail.search.StringTerm:
getIgnoreCasegetPatternhashCodematch

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.mail.search.StringTerm.serialVersionUID.

Constructor Detail

BodyTermback to summary
public BodyTerm(String pattern)

Constructor

Parameters
pattern:String

The String to search for

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides javax.mail.search.StringTerm.equals.

Equality comparison.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
matchback to summary
public boolean match(Message msg)

Implements abstract javax.mail.search.SearchTerm.match.

The match method.

Parameters
msg:Message

The pattern search is applied on this Message's body

Returns:boolean

true if the pattern is found; otherwise false

Annotations
@Override
matchPartback to summary
private boolean matchPart(Part p)

Search all the parts of the message for any text part that matches the pattern.