Top Description Fields Constructors Methods
liquibase.util

public final Class ExpressionMatcher

extends Object
Class Inheritance
Imports
liquibase.exception.UnexpectedLiquibaseException, java.util.Collection, java.util.regex.Matcher, .Pattern

Common functionality for matching set of Context/Labels against provided expression. Supported syntax: - ! / not - to negate expression/token - and - conjunction operator - or - disjunction operator - () - increase evaluation order priority for sub-expression

Examples: "(a and b) or (c and d)" "!a and b"

Usage:

See Also
liquibase.LabelExpression, liquibase.ContextExpression

Field Summary

Modifier and TypeField and Description
private static final Pattern
NESTED_EXPRESSION_PATTERN

find "(nested_expression)" in "left and (nested_expression) or right" expression

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if provided list of items satisfy expression criteria. false otherwise.
matches
(String
- expression that will be parsed and evaluated against provided list of items
expression
,
Collection<String>
- list of items
items
)

Test provided expression against list of items.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NESTED_EXPRESSION_PATTERNback to summary
private static final Pattern NESTED_EXPRESSION_PATTERN

find "(nested_expression)" in "left and (nested_expression) or right" expression

Constructor Detail

ExpressionMatcherback to summary
private ExpressionMatcher()

Method Detail

matchesback to summary
public static boolean matches(String expression, Collection<String> items)

Test provided expression against list of items. Case insensitive.

Parameters
expression:String

- expression that will be parsed and evaluated against provided list of items

items:Collection<String>

- list of items

Returns:boolean

true if provided list of items satisfy expression criteria. false otherwise.