org.apache.activemq.console.filter
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
public abstract class RegExQueryFilter
- extends AbstractQueryFilter
Constructor Summary |
protected |
RegExQueryFilter(QueryFilter next)
Creates a regular expression query that is able to match an object using key-value pattern regex filtering |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REGEX_PREFIX
public static final String REGEX_PREFIX
- See Also:
- Constant Field Values
RegExQueryFilter
protected RegExQueryFilter(QueryFilter next)
- Creates a regular expression query that is able to match an object using key-value pattern regex filtering
- Parameters:
next
-
query
public List query(List queries)
throws Exception
- 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
protected boolean isRegularExpression(String query)
- 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:
compileQuery
protected Pattern compileQuery(String query)
- Compiles the regex query to a pattern.
- Parameters:
query
- - query string to compile
- Returns:
- regex pattern
filterCollectionUsingRegEx
protected List filterCollectionUsingRegEx(Map regex,
List data)
throws Exception
- 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
protected abstract boolean matches(Object data,
Map regex)
throws Exception
- 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
Copyright © 2011 Apache Software Foundation. All Rights Reserved.