|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mockrunner.jdbc.SQLStatementMatcher
public class SQLStatementMatcher
Helper class for finding matching SQL statements based on various
search parameters. The search parameters are:
caseSensitive do a case sensitive match (default is false)
exactMatch the strings must match exactly, the parameter caseSensitive
is recognized, but useRegularExpression is irrelevant,
if exactMatch is true (default is false)
useRegularExpression use regular expressions for matching, if this parameter is
false, strings match, if one string starts with the other
(default is false)
| Constructor Summary | |
|---|---|
SQLStatementMatcher(boolean caseSensitive,
boolean exactMatch)
|
|
SQLStatementMatcher(boolean caseSensitive,
boolean exactMatch,
boolean useRegularExpressions)
|
|
| Method Summary | |
|---|---|
boolean |
contains(java.util.Collection col,
java.lang.String query,
boolean queryContainsData)
Compares all elements in the specified Collection with the
specified query string using the method doStringsMatch(java.lang.String, java.lang.String). |
boolean |
doStringsMatch(java.lang.String source,
java.lang.String query)
Compares two strings and returns if they match. |
java.util.List |
getMatchingObjects(java.util.Map dataMap,
java.lang.String query,
boolean resolveCollection,
boolean queryContainsMapData)
Compares all keys in the specified Map with the
specified query string using the method doStringsMatch(java.lang.String, java.lang.String). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLStatementMatcher(boolean caseSensitive,
boolean exactMatch)
public SQLStatementMatcher(boolean caseSensitive,
boolean exactMatch,
boolean useRegularExpressions)
| Method Detail |
|---|
public java.util.List getMatchingObjects(java.util.Map dataMap,
java.lang.String query,
boolean resolveCollection,
boolean queryContainsMapData)
Map with the
specified query string using the method doStringsMatch(java.lang.String, java.lang.String).
If the strings match, the corresponding object from the Map
is added to the resulting List.
dataMap - the source Mapquery - the query string that must match the keys in dataMapqueryContainsMapData - only matters if isExactMatch is false,
specifies if query must be contained in the Map keys (false)
or if query must contain the Map keys (true)
List
public boolean contains(java.util.Collection col,
java.lang.String query,
boolean queryContainsData)
Collection with the
specified query string using the method doStringsMatch(java.lang.String, java.lang.String).
col - the Collectionsquery - the query string that must match the keys in colqueryContainsData - only matters if exactMatch is false,
specifies if query must be contained in the Collection data (false)
or if query must contain the Collection data (true)
true if col contains query, false otherwise
public boolean doStringsMatch(java.lang.String source,
java.lang.String query)
query - the query string that must match sourcesource - the source string
true of the strings match, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||