org.jivesoftware.smack.filter
Class FromMatchesFilter
java.lang.Object
org.jivesoftware.smack.filter.FromMatchesFilter
- All Implemented Interfaces:
- PacketFilter
public class FromMatchesFilter
- extends Object
- implements PacketFilter
Filter for packets where the "from" field exactly matches a specified JID. If the specified
address is a bare JID then the filter will match any address whose bare JID matches the
specified JID. But if the specified address is a full JID then the filter will only match
if the sender of the packet matches the specified resource.
- Author:
- Gaston Dombiak
FromMatchesFilter
public FromMatchesFilter(String address)
- Creates a "from" filter using the "from" field part. If the specified address is a bare JID
then the filter will match any address whose bare JID matches the specified JID. But if the
specified address is a full JID then the filter will only match if the sender of the packet
matches the specified resource.
- Parameters:
address
- the from field value the packet must match. Could be a full or bare JID.
accept
public boolean accept(Packet packet)
- Description copied from interface:
PacketFilter
- Tests whether or not the specified packet should pass the filter.
- Specified by:
accept
in interface PacketFilter
- Parameters:
packet
- the packet to test.
- Returns:
- true if and only if packet passes the filter.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2003-2007 Jive Software.