The Builder concept is going away, do not use it during XPath parsing.
JIRA: YANGTOOLS-1328
Change-Id: I4f9547d38d8786f7b9b771f264f6e941c11fb089
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.concepts.Mutable;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
* is not correctly serialized or does not represent instance identifier valid
* for associated schema context.
*/
* is not correctly serialized or does not represent instance identifier valid
* for associated schema context.
*/
-final class XpathStringParsingPathArgumentBuilder implements Builder<List<PathArgument>> {
-
+final class XpathStringParsingPathArgumentBuilder implements Mutable {
/**
* Matcher matching WSP YANG ABNF token.
*/
/**
* Matcher matching WSP YANG ABNF token.
*/
XpathStringParsingPathArgumentBuilder(final AbstractStringInstanceIdentifierCodec codec, final String data) {
this.codec = requireNonNull(codec);
this.data = requireNonNull(data);
XpathStringParsingPathArgumentBuilder(final AbstractStringInstanceIdentifierCodec codec, final String data) {
this.codec = requireNonNull(codec);
this.data = requireNonNull(data);
final DataSchemaContextTree tree = codec.getDataContextTree();
final DataSchemaContextTree tree = codec.getDataContextTree();
- this.stack = SchemaInferenceStack.of(tree.getEffectiveModelContext());
- this.current = tree.getRoot();
+ stack = SchemaInferenceStack.of(tree.getEffectiveModelContext());
+ current = tree.getRoot();
- @Override
- public List<PathArgument> build() {
+ /**
+ * Parse input string and return the corresponding list of {@link PathArgument}s.
+ *
+ * @return List of PathArguments
+ * @throws IllegalArgumentException if the input string is not valid
+ */
+ @NonNull List<PathArgument> build() {
while (!allCharactersConsumed()) {
product.add(computeNextArgument());
}
while (!allCharactersConsumed()) {
product.add(computeNextArgument());
}