public abstract class OsgiFilterUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
EQUALS |
private static java.lang.String |
FILTER_AND_CONSTRAINT |
private static char |
FILTER_BEGIN |
private static char |
FILTER_END |
| Constructor and Description |
|---|
OsgiFilterUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.osgi.framework.Filter |
createFilter(java.lang.String filter)
Creates an OSGi
Filter from the given String. |
static java.lang.String |
getFilter(org.osgi.framework.ServiceReference reference)
Creates a filter (as String) that matches the properties (expect the service id) of service reference.
|
static boolean |
isValidFilter(java.lang.String filter)
Validates the given String as a OSGi filter.
|
static java.lang.String |
unifyFilter(java.lang.Class<?>[] classes,
java.lang.String filter)
Adds the given classes to the given filter.
|
static java.lang.String |
unifyFilter(java.lang.Class<?> clazz,
java.lang.String filter)
Adds the given class to the given filter.
|
static java.lang.String |
unifyFilter(java.lang.String[] classes,
java.lang.String filter)
Adds the given classes as an 'and'(&)
Constants.OBJECTCLASS constraint to the given filter. |
static java.lang.String |
unifyFilter(java.lang.String clazz,
java.lang.String filter)
Adds the given class as an 'and'(&)
Constants.OBJECTCLASS constraint to the given filter. |
static java.lang.String |
unifyFilter(java.lang.String key,
java.lang.String[] items,
java.lang.String filter)
Concatenates the given strings with an 'and'(&) constraint under the given key to the given filter.
|
private static final char FILTER_BEGIN
private static final char FILTER_END
private static final java.lang.String FILTER_AND_CONSTRAINT
private static final java.lang.String EQUALS
public static java.lang.String unifyFilter(java.lang.String clazz,
java.lang.String filter)
Constants.OBJECTCLASS constraint to the given filter. At least
one parameter must be valid (non-null).clazz - class name (can be null)filter - valid OSGi filter (can be null)Constants.OBJECTCLASS constraint and the given filterpublic static java.lang.String unifyFilter(java.lang.Class<?> clazz,
java.lang.String filter)
null).clazz - fully qualified class name (can be null)filter - valid OSGi filter (can be null)unifyFilter(String, String)public static java.lang.String unifyFilter(java.lang.Class<?>[] classes,
java.lang.String filter)
null).classes - array of fully qualified class names (can be null/empty)filter - valid OSGi filter (can be null)unifyFilter(String[], String)public static java.lang.String unifyFilter(java.lang.String[] classes,
java.lang.String filter)
Constants.OBJECTCLASS constraint to the given filter. At least
one parameter must be valid (non-null).classes - array of fully qualified class names (can be null/empty)filter - valid OSGi filter (can be null)public static java.lang.String unifyFilter(java.lang.String key,
java.lang.String[] items,
java.lang.String filter)
null).key - the key under which the items are being concatenated (required)items - an array of strings concatenated to the existing filterfilter - valid OSGi filter (can be null)public static boolean isValidFilter(java.lang.String filter)
filter - OSGi filterpublic static org.osgi.framework.Filter createFilter(java.lang.String filter)
Filter from the given String. Translates the InvalidSyntaxException checked
exception into an unchecked IllegalArgumentException.filter - OSGi filter given as a StringFilter)public static java.lang.String getFilter(org.osgi.framework.ServiceReference reference)
reference -