Package liquibase
Class ContextExpression
java.lang.Object
liquibase.ContextExpression
Encapsulates logic for evaluating if a set of runtime contexts matches a context expression string.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPseudo-context that evaluates totruewhen no runtime contexts are specified. -
Constructor Summary
ConstructorsConstructorDescriptionContextExpression(String contexts) ContextExpression(String... contexts) ContextExpression(Collection<String> contexts) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanisEmpty()booleanReturns true if the passed runtime contexts match this context expressionstatic booleanmatchesAll(Collection<ContextExpression> expressions, Contexts contexts) toString()
-
Field Details
-
NOCONTEXTS
Pseudo-context that evaluates totruewhen no runtime contexts are specified.This can be used in context expressions to opt into stricter context-matching behaviour while keeping backward compatibility. For example, a changeset with
context="!nocontexts AND specificcontext"will only be applied when at least one runtime context is provided and that context matchesspecificcontext. When no runtime context is specified thenocontextspseudo-context evaluates totrue, so!nocontextsevaluates tofalseand the changeset is skipped.- See Also:
-
-
Constructor Details
-
ContextExpression
-
ContextExpression
-
ContextExpression
-
-
Method Details