mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Cleanup texts and comments
This commit is contained in:
parent
86a4bfa43f
commit
4cb799228c
7 changed files with 22 additions and 24 deletions
|
@ -51,11 +51,11 @@ public class AndFilter implements PacketFilter {
|
|||
*/
|
||||
public AndFilter(PacketFilter... filters) {
|
||||
if (filters == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
for(PacketFilter filter : filters) {
|
||||
if(filter == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
}
|
||||
this.filters = new ArrayList<PacketFilter>(Arrays.asList(filters));
|
||||
|
@ -69,7 +69,7 @@ public class AndFilter implements PacketFilter {
|
|||
*/
|
||||
public void addFilter(PacketFilter filter) {
|
||||
if (filter == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
filters.add(filter);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class NotFilter implements PacketFilter {
|
|||
*/
|
||||
public NotFilter(PacketFilter filter) {
|
||||
if (filter == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
this.filter = filter;
|
||||
}
|
||||
|
|
|
@ -51,11 +51,11 @@ public class OrFilter implements PacketFilter {
|
|||
*/
|
||||
public OrFilter(PacketFilter... filters) {
|
||||
if (filters == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
for(PacketFilter filter : filters) {
|
||||
if(filter == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
}
|
||||
this.filters = new ArrayList<PacketFilter>(Arrays.asList(filters));
|
||||
|
@ -69,7 +69,7 @@ public class OrFilter implements PacketFilter {
|
|||
*/
|
||||
public void addFilter(PacketFilter filter) {
|
||||
if (filter == null) {
|
||||
throw new IllegalArgumentException("Parameter cannot be null.");
|
||||
throw new IllegalArgumentException("Parameter must not be null.");
|
||||
}
|
||||
filters.add(filter);
|
||||
}
|
||||
|
|
|
@ -20,24 +20,22 @@ package org.jivesoftware.smack.filter;
|
|||
import org.jivesoftware.smack.packet.Packet;
|
||||
|
||||
/**
|
||||
* Defines a way to filter packets for particular attributes. Packet filters are
|
||||
* used when constructing packet listeners or collectors -- the filter defines
|
||||
* what packets match the criteria of the collector or listener for further
|
||||
* packet processing.<p>
|
||||
*
|
||||
* Several pre-defined filters are defined. These filters can be logically combined
|
||||
* for more complex packet filtering by using the
|
||||
* {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and
|
||||
* {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible
|
||||
* to define your own filters by implementing this interface. The code example below
|
||||
* creates a trivial filter for packets with a specific ID.
|
||||
* Defines a way to filter packets for particular attributes. Packet filters are used when
|
||||
* constructing packet listeners or collectors -- the filter defines what packets match the criteria
|
||||
* of the collector or listener for further packet processing.
|
||||
* <p>
|
||||
* Several simple filters are pre-defined. These filters can be logically combined for more complex
|
||||
* packet filtering by using the {@link org.jivesoftware.smack.filter.AndFilter AndFilter} and
|
||||
* {@link org.jivesoftware.smack.filter.OrFilter OrFilter} filters. It's also possible to define
|
||||
* your own filters by implementing this interface. The code example below creates a trivial filter
|
||||
* for packets with a specific ID (real code should use {@link PacketIDFilter} instead).
|
||||
*
|
||||
* <pre>
|
||||
* // Use an anonymous inner class to define a packet filter that returns
|
||||
* // all packets that have a packet ID of "RS145".
|
||||
* // all packets that have a packet ID of "RS145".
|
||||
* PacketFilter myFilter = new PacketFilter() {
|
||||
* public boolean accept(Packet packet) {
|
||||
* return "RS145".equals(packet.getPacketID());
|
||||
* return "RS145".equals(packet.getPacketID());
|
||||
* }
|
||||
* };
|
||||
* // Create a new packet collector using the filter we created.
|
||||
|
|
|
@ -35,7 +35,7 @@ public class PacketIDFilter implements PacketFilter {
|
|||
*/
|
||||
public PacketIDFilter(String packetID) {
|
||||
if (packetID == null) {
|
||||
throw new IllegalArgumentException("Packet ID cannot be null.");
|
||||
throw new IllegalArgumentException("Packet ID must not be null.");
|
||||
}
|
||||
this.packetID = packetID;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ThreadFilter implements PacketFilter {
|
|||
*/
|
||||
public ThreadFilter(String thread) {
|
||||
if (thread == null) {
|
||||
throw new IllegalArgumentException("Thread cannot be null.");
|
||||
throw new IllegalArgumentException("Thread must not be null.");
|
||||
}
|
||||
this.thread = thread;
|
||||
}
|
||||
|
|
|
@ -235,8 +235,8 @@ public abstract class Packet {
|
|||
|
||||
/**
|
||||
* Returns the first packet extension that matches the specified element name and
|
||||
* namespace, or <tt>null</tt> if it doesn't exist. If the provided elementName is null
|
||||
* than only the provided namespace is attempted to be matched. Packet extensions are
|
||||
* namespace, or <tt>null</tt> if it doesn't exist. If the provided elementName is null,
|
||||
* only the namespace is matched. Packet extensions are
|
||||
* are arbitrary XML sub-documents in standard XMPP packets. By default, a
|
||||
* DefaultPacketExtension instance will be returned for each extension. However,
|
||||
* PacketExtensionProvider instances can be registered with the
|
||||
|
|
Loading…
Reference in a new issue