|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.utils.filter.FilterImpl
public class FilterImpl
This filter implementation is based on the official OSGi filter with additional support for the SUPERSET (>*) and SUBSET (<*) operators. This filter also has a few optimizations (cached transformation).
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this Filter to another Filter . |
int |
hashCode()
Returns the hashCode for this Filter . |
boolean |
match(java.util.Dictionary dictionary)
Filter using a Dictionary . |
boolean |
match(org.osgi.framework.ServiceReference reference)
Filter using a service's properties. |
boolean |
matchCase(java.util.Dictionary dictionary)
Filter with case sensitivity using a Dictionary . |
boolean |
matchCase(java.util.Map map)
Filter using a Map . |
boolean |
matches(java.util.Map<java.lang.String,?> map)
Filter using a Map . |
static FilterImpl |
newInstance(java.lang.String filterString)
Constructs a FilterImpl object. |
static FilterImpl |
newInstance(java.lang.String filterString,
boolean ignoreCase)
|
java.lang.String |
toString()
Returns this Filter 's filter string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static FilterImpl newInstance(java.lang.String filterString) throws org.osgi.framework.InvalidSyntaxException
FilterImpl
object. This filter object may be
used to match a ServiceReference
or a Dictionary.
If the filter cannot be parsed, an InvalidSyntaxException
will be thrown with a human readable message where the filter became
unparsable.
filterString
- the filter string.
org.osgi.framework.InvalidSyntaxException
- If the filter parameter contains an
invalid filter string that cannot be parsed.public static FilterImpl newInstance(java.lang.String filterString, boolean ignoreCase) throws org.osgi.framework.InvalidSyntaxException
org.osgi.framework.InvalidSyntaxException
public boolean match(org.osgi.framework.ServiceReference reference)
This Filter
is executed using the keys and values of the
referenced service's properties. The keys are case insensitively
matched with this Filter
.
match
in interface org.osgi.framework.Filter
reference
- The reference to the service whose properties are
used in the match.
true
if the service's properties match this
Filter
; false
otherwise.public boolean match(java.util.Dictionary dictionary)
Dictionary
. This Filter
is
executed using the specified Dictionary
's keys and
values. The keys are case insensitively matched with this
Filter
.
match
in interface org.osgi.framework.Filter
dictionary
- The Dictionary
whose keys are used in
the match.
true
if the Dictionary
's keys and
values match this filter; false
otherwise.
java.lang.IllegalArgumentException
- If dictionary
contains
case variants of the same key name.public boolean matchCase(java.util.Dictionary dictionary)
Dictionary
. This
Filter
is executed using the specified
Dictionary
's keys and values. The keys are case
sensitively matched with this Filter
.
matchCase
in interface org.osgi.framework.Filter
dictionary
- The Dictionary
whose keys are used in
the match.
true
if the Dictionary
's keys and
values match this filter; false
otherwise.public boolean matchCase(java.util.Map map)
Map
. This Filter
is
executed using the specified Map
's keys and
values. The keys are case insensitively matched with this
Filter
.
map
- The Map
whose keys are used in
the match.
true
if the Map
's keys and
values match this filter; false
otherwise.
java.lang.IllegalArgumentException
- If map
contains
case variants of the same key name.public boolean matches(java.util.Map<java.lang.String,?> map)
Map
. This Filter
is
executed using the specified Map
's keys and
values. The keys are case insensitively matched with this
Filter
.
matches
in interface org.osgi.framework.Filter
map
- The Map
whose keys are used in
the match.
true
if the Map
's keys and
values match this filter; false
otherwise.
java.lang.IllegalArgumentException
- If map
contains
case variants of the same key name.public java.lang.String toString()
Filter
's filter string.
The filter string is normalized by removing whitespace which does not affect the meaning of the filter.
toString
in interface org.osgi.framework.Filter
toString
in class java.lang.Object
Filter
's filter string.public boolean equals(java.lang.Object obj)
Filter
to another Filter
.
This implementation returns the result of calling
this.toString().equals(obj.toString()
.
equals
in interface org.osgi.framework.Filter
equals
in class java.lang.Object
obj
- The object to compare against this Filter
.
Filter
object, then
returns the result of calling
this.toString().equals(obj.toString()
;
false
otherwise.public int hashCode()
Filter
.
This implementation returns the result of calling
this.toString().hashCode()
.
hashCode
in interface org.osgi.framework.Filter
hashCode
in class java.lang.Object
Filter
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |