Class RegExQueryFilter
java.lang.Object
org.apache.activemq.console.filter.AbstractQueryFilter
org.apache.activemq.console.filter.RegExQueryFilter
- All Implemented Interfaces:
QueryFilter
- Direct Known Subclasses:
MBeansRegExQueryFilter
-
Field Summary
FieldsFields inherited from class org.apache.activemq.console.filter.AbstractQueryFilter
nextFields inherited from interface org.apache.activemq.console.filter.QueryFilter
QUERY_DELIMETER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRegExQueryFilter(QueryFilter next) Creates a regular expression query that is able to match an object using key-value pattern regex filtering -
Method Summary
Modifier and TypeMethodDescriptionprotected PatterncompileQuery(String query) Compiles the regex query to a pattern.protected ListfilterCollectionUsingRegEx(Map regex, List data) Filter the specified colleciton using the regex patterns extracted.protected booleanisRegularExpression(String query) Checks if a given string is a regular expression query.protected abstract booleanDetermines how the object is to be matched to the regex map.Separates the regular expressions queries from the usual queries.Methods inherited from class org.apache.activemq.console.filter.AbstractQueryFilter
query
-
Field Details
-
REGEX_PREFIX
- See Also:
-
-
Constructor Details
-
RegExQueryFilter
Creates a regular expression query that is able to match an object using key-value pattern regex filtering- Parameters:
next-
-
-
Method Details
-
query
Separates the regular expressions queries from the usual queries. A query is a regex query, if it is key-value pair with the format= , and value is a pattern that satisfies the isRegularExpression method. - Parameters:
queries- - list of queries- Returns:
- filtered objects that matches the regex query
- Throws:
Exception
-
isRegularExpression
Checks if a given string is a regular expression query. Currently, a pattern is a regex query, if it starts with the RegExQueryFilter.REGEX_PREFIX.- Parameters:
query-- Returns:
- boolean result of query check
-
compileQuery
Compiles the regex query to a pattern.- Parameters:
query- - query string to compile- Returns:
- regex pattern
-
filterCollectionUsingRegEx
Filter the specified colleciton using the regex patterns extracted.- Parameters:
regex- - regex mapdata- - list of objects to filter- Returns:
- filtered list of objects that matches the regex map
- Throws:
Exception
-
matches
Determines how the object is to be matched to the regex map.- Parameters:
data- - object to matchregex- - regex map- Returns:
- true, if the object matches the regex map, false otherwise
- Throws:
Exception
-