diff options
Diffstat (limited to 'cps-path-parser/src/main/java/org')
-rw-r--r-- | cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathBuilder.java | 6 | ||||
-rw-r--r-- | cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathQuery.java | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathBuilder.java b/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathBuilder.java index 4299d13081..854450c8bb 100644 --- a/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathBuilder.java +++ b/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathBuilder.java @@ -150,6 +150,12 @@ public class CpsPathBuilder extends CpsPathBaseListener { } @Override + public void exitContainsFunctionCondition(final CpsPathParser.ContainsFunctionConditionContext ctx) { + cpsPathQuery.setContainsFunctionConditionLeafName(ctx.leafName().getText()); + cpsPathQuery.setContainsFunctionConditionValue(stripFirstAndLastCharacter(ctx.StringLiteral().getText())); + } + + @Override public void enterListElementRef(final CpsPathParser.ListElementRefContext ctx) { normalizedXpathBuilder.append(OPEN_BRACKET); if (processingAncestorAxis) { diff --git a/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathQuery.java b/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathQuery.java index 2c96d91051..418b5ec55b 100644 --- a/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathQuery.java +++ b/cps-path-parser/src/main/java/org/onap/cps/cpspath/parser/CpsPathQuery.java @@ -44,6 +44,8 @@ public class CpsPathQuery { private String textFunctionConditionLeafName; private String textFunctionConditionValue; private List<String> booleanOperatorsType; + private String containsFunctionConditionLeafName; + private String containsFunctionConditionValue; /** * Returns a cps path query. @@ -83,6 +85,15 @@ public class CpsPathQuery { } /** + * Has contains function condition been included in cpsPath. + * + * @return boolean value. + */ + public boolean hasContainsFunctionCondition() { + return containsFunctionConditionLeafName != null; + } + + /** * Returns boolean indicating xpath is an absolute path to a list element. * * @return true if xpath is an absolute path to a list element |