Package org.apache.felix.utils.resource
Class SimpleFilter
java.lang.Object
org.apache.felix.utils.resource.SimpleFilter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
private static final ConcurrentHashMap
<String, String> Strings which are commonly found in filter specification.static final int
static final int
static final int
static final int
static final SimpleFilter
private final String
static final int
private final int
static final int
static final int
static final int
private final Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
compareSubstring
(List<String> pieces, String s) static SimpleFilter
Converts a attribute map to a filter.getName()
int
getValue()
static SimpleFilter
parseSubstring
(String value) private static String
reuseCommonString
(String str) private static int
skipWhitespace
(String s, int startIdx) private static SimpleFilter
private static String
toDecodedString
(String s, int startIdx, int endIdx) private static void
toEncodedString
(StringBuilder sb, Object o) toString()
private void
private static void
toString
(StringBuilder sb, List<?> list) static void
unparseSubstring
(StringBuilder sb, List<?> pieces)
-
Field Details
-
MATCH_ALL
public static final int MATCH_ALL- See Also:
-
AND
public static final int AND- See Also:
-
OR
public static final int OR- See Also:
-
NOT
public static final int NOT- See Also:
-
EQ
public static final int EQ- See Also:
-
LTE
public static final int LTE- See Also:
-
GTE
public static final int GTE- See Also:
-
SUBSTRING
public static final int SUBSTRING- See Also:
-
PRESENT
public static final int PRESENT- See Also:
-
APPROX
public static final int APPROX- See Also:
-
COMMON_STRINGS
Strings which are commonly found in filter specification. We use this map as an interner. -
MATCH_ALL_FILTER
-
name
-
value
-
op
private final int op
-
-
Constructor Details
-
SimpleFilter
-
-
Method Details
-
getName
-
getValue
-
getOperation
public int getOperation() -
toString
-
toString
-
reuseCommonString
-
toString
-
toDecodedString
-
toEncodedString
-
parse
-
subfilter
-
parseSubstring
-
unparseSubstring
-
compareSubstring
-
skipWhitespace
-
convert
Converts a attribute map to a filter. The filter is created by iterating over the map's entry set. If ordering of attributes is important (e.g., for hitting attribute indices), then the map's entry set should iterate in the desired order. Equality testing is assumed for all attribute types other than version ranges, which are handled appropriated. If the attribute map is empty, then a filter that matches anything is returned.- Parameters:
attrs
- Map of attributes to convert to a filter.- Returns:
- A filter corresponding to the attributes.
-