Use FilterParameter for communicating its value
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / FilterParameter.java
index 5c6aed3efeebec0504e471ed505c099fe6092a73..2c2777081ee5b5520c49e189164dc68a28067d74 100644 (file)
@@ -10,12 +10,8 @@ package org.opendaylight.restconf.nb.rfc8040;
 import static java.util.Objects.requireNonNull;
 
 import java.net.URI;
-import javax.xml.xpath.XPathExpressionException;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.opendaylight.yangtools.concepts.Immutable;
-import org.opendaylight.yangtools.yang.xpath.api.YangXPathExpression;
-import org.opendaylight.yangtools.yang.xpath.api.YangXPathMathMode;
-import org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory;
 
 /**
  * This class represents a {@code filter} parameter as defined in
@@ -25,25 +21,25 @@ import org.opendaylight.yangtools.yang.xpath.api.YangXPathParserFactory;
 public final class FilterParameter implements Immutable {
     private static final URI CAPABILITY = URI.create("urn:ietf:params:restconf:capability:filter:1.0");
 
-    private final YangXPathExpression value;
+    // FIXME: can we have a parsed, but not bound version of an XPath, please?
+    private final String value;
 
-    private FilterParameter(final YangXPathExpression value) {
+    private FilterParameter(final String value) {
         this.value = requireNonNull(value);
     }
 
-    public static FilterParameter forUriValue(final YangXPathParserFactory parserFactory, final String uriValue)
-            throws XPathExpressionException {
-        return new FilterParameter(parserFactory.newParser(YangXPathMathMode.EXACT).parseExpression(uriValue));
-    }
-
-    public YangXPathExpression value() {
-        return value;
+    public static FilterParameter forUriValue(final String uriValue) {
+        return new FilterParameter(uriValue);
     }
 
     public static String uriName() {
         return "filter";
     }
 
+    public String uriValue() {
+        return value;
+    }
+
     public static URI capabilityUri() {
         return CAPABILITY;
     }