def CharSequence printUses(UsesNode usesNode) {
return '''
- «strong(listItem("uses", typeAnchorLink(usesNode.groupingPath, usesNode.groupingPath.path.last.localName)))»
+ «strong(listItem("uses", typeAnchorLink(usesNode.groupingPath, usesNode.groupingPath.pathTowardsRoot.iterator.next.localName)))»
<ul>
<li>refines:
<ul>
Preconditions.checkArgument(context != null, "Schema Context reference cannot be NULL");
Preconditions.checkArgument(schemaPath != null, "Schema Path reference cannot be NULL");
- final List<QName> prefixedPath = (schemaPath.getPath());
+ final Iterable<QName> prefixedPath = schemaPath.getPathFromRoot();
if (prefixedPath == null) {
LOG.debug("Schema path {} has null path", schemaPath);
return null;
}
private static DataSchemaNode findCorrectTargetFromGrouping(final DataSchemaNode node, final SchemaContext ctx) {
- if (node.getPath().getPath().size() != 1) {
+ if (Iterables.size(node.getPath().getPathTowardsRoot()) != 1) {
QName currentName = node.getQName();
// tmpPath is used to track level of nesting
List<QName> tmpPath = new ArrayList<>();
}
EnumPairImpl result = new EnumPairImpl();
- result.qname = path.getPath().get(path.getPath().size() - 1);
+ result.qname = path.getPathTowardsRoot().iterator().next();
result.path = path;
result.description = description;
result.reference = reference;
}
final List<UnknownSchemaNode> unknownNodes = Collections.emptyList();
- return new BitImpl(position, schemaPath.getPath().get(schemaPath.getPath().size() - 1), schemaPath,
+ return new BitImpl(position, schemaPath.getPathTowardsRoot().iterator().next(), schemaPath,
description, reference, status, unknownNodes);
}