@Override public Iterable<QName> getSchemaPath() { return this.schemaPath.getPathFromRoot(); }
@Override public Iterable<QName> getSchemaPath() { return this.schemaPath.getPathFromRoot(); }
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) { return toStringHelper.add("path", getPathFromRoot()); } }
protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) { return toStringHelper.add("path", getPathFromRoot()); } }
public static LeafRefContext getLeafRefReferencingContext( final SchemaPath schemaPath, final LeafRefContext root) { final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot(); return getLeafRefReferencingContext(pathFromRoot, root); }
public static List<LeafRefContext> findAllChildsReferencedByLeafRef(final SchemaPath schemaPath, final LeafRefContext root) { return findAllChildsReferencedByLeafRef(schemaPath.getPathFromRoot(), root); }
public static LeafRefContext getLeafRefReferencedByContext( final SchemaPath schemaPath, final LeafRefContext root) { final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot(); return getLeafRefReferencedByContext(pathFromRoot, root); }
public static LeafRefContext getLeafRefReferencedByContext( final SchemaPath schemaPath, final LeafRefContext root) { final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot(); return getLeafRefReferencedByContext(pathFromRoot, root); }
public static LeafRefContext getLeafRefReferencingContext( final SchemaPath schemaPath, final LeafRefContext root) { final Iterable<QName> pathFromRoot = schemaPath.getPathFromRoot(); return getLeafRefReferencingContext(pathFromRoot, root); }
public static Optional<NormalizedNode<?, ?>> findNode(final NormalizedNode<?, ?> parent, final SchemaPath relativePath) { checkArgument(!relativePath.isAbsolute(), "%s is not a relative path", relativePath); return findNode(Optional.ofNullable(parent), Iterables.transform(relativePath.getPathFromRoot(), NodeIdentifier::new)); }
public static Optional<NormalizedNode<?, ?>> findNode(final NormalizedNode<?, ?> parent, final SchemaPath relativePath) { checkArgument(!relativePath.isAbsolute(), "%s is not a relative path", relativePath); return findNode(Optional.ofNullable(parent), Iterables.transform(relativePath.getPathFromRoot(), NodeIdentifier::new)); }
private GroupingDefinition findUsedGrouping(final UsesNode uses) { final SchemaNode targetGrouping = findNodeInSchemaContext(schemaContext, uses.getGroupingPath() .getPathFromRoot()); if (targetGrouping instanceof GroupingDefinition) { return (GroupingDefinition) targetGrouping; } throw new IllegalArgumentException("Failed to resolve used grouping for " + uses); }
Module getLeafRefContextModule() { final Iterator<QName> it = currentNodePath.getPathFromRoot().iterator(); final QNameModule qnameModule = it.hasNext() ? it.next().getModule() : currentNodeQName.getModule(); return schemaContext.findModule(qnameModule).orElse(null); }
Module getLeafRefContextModule() { final Iterator<QName> it = currentNodePath.getPathFromRoot().iterator(); final QNameModule qnameModule = it.hasNext() ? it.next().getModule() : currentNodeQName.getModule(); return schemaContext.findModule(qnameModule).orElse(null); }
private Module getParentModule(final SchemaNode node) { final QName qname = node.getPath().getPathFromRoot().iterator().next(); return schemaContext.findModule(qname.getModule()).orElse(null); }
private void emitTypeNode(final SchemaPath parentPath, final TypeDefinition<?> subtype) { final SchemaPath path = subtype.getPath(); if (isPrefix(parentPath.getPathFromRoot(), path.getPathFromRoot())) { emitTypeNodeDerived(subtype); } else { emitTypeNodeReferenced(subtype); } }
private static boolean isLocalAugment(final AugmentationTarget container, final AugmentationSchemaNode augment) { Preconditions.checkState(container instanceof SchemaNode); final QName root = ((SchemaNode) container).getPath().getPathFromRoot().iterator().next(); // findFirst makes no sense but just pick up one child to judge whether the target node is // in the same module. final Optional<DataSchemaNode> child = augment.getChildNodes().stream().findFirst(); if (child.isPresent()) { return root.getModule().equals(child.get().getQName().getModule()); } return false; }
/** * Create a child path based on concatenation of this path and a relative path. * * @param relative Relative SchemaPath * @return A new child path */ public @NonNull SchemaPath createChild(final SchemaPath relative) { checkArgument(!relative.isAbsolute(), "Child creation requires relative path"); return createChild(relative.getPathFromRoot()); }
private Module getParentModule(final SchemaNode node) { QName qname = node.getPath().getPathFromRoot().iterator().next(); URI namespace = qname.getNamespace(); Date revision = qname.getRevision(); return schemaContext.findModuleByNamespaceAndRevision(namespace, revision); }
private boolean emitCheck(final DataSchemaNode schemaChild) { if (schemaChild.isAugmenting()) { QName root = schemaChild.getPath().getPathFromRoot().iterator().next(); return root.getModule().equals(schemaChild.getQName().getModule()); } return true; }