throw new UnsupportedOperationException();
}
- public static LeafRefContext getLeafRefReferencingContext(final SchemaNode node,
- final LeafRefContext root) {
+ public static LeafRefContext getLeafRefReferencingContext(final SchemaNode node, final LeafRefContext root) {
final SchemaPath schemaPath = node.getPath();
return getLeafRefReferencingContext(schemaPath, root);
}
return getLeafRefReferencingContext(pathFromRoot, root);
}
- public static LeafRefContext getLeafRefReferencingContext(
- final Iterable<QName> pathFromRoot, LeafRefContext root) {
-
+ public static LeafRefContext getLeafRefReferencingContext(final Iterable<QName> pathFromRoot, LeafRefContext root) {
LeafRefContext leafRefCtx = null;
final Iterator<QName> iterator = pathFromRoot.iterator();
while (iterator.hasNext() && root != null) {
return leafRefCtx;
}
- public static LeafRefContext getLeafRefReferencedByContext(final SchemaNode node,
- final LeafRefContext root) {
+ public static LeafRefContext getLeafRefReferencedByContext(final SchemaNode node, final LeafRefContext root) {
final SchemaPath schemaPath = node.getPath();
return getLeafRefReferencedByContext(schemaPath, root);
}
return getLeafRefReferencedByContext(pathFromRoot, root);
}
- public static LeafRefContext getLeafRefReferencedByContext(
- final Iterable<QName> pathFromRoot, LeafRefContext root) {
+ public static LeafRefContext getLeafRefReferencedByContext(final Iterable<QName> pathFromRoot,
+ LeafRefContext root) {
LeafRefContext leafRefCtx = null;
final Iterator<QName> iterator = pathFromRoot.iterator();
}
public static boolean isLeafRef(final SchemaNode node, final LeafRefContext root) {
-
if (node == null || root == null) {
return false;
}
- final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(
- node, root);
+ final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(node, root);
if (leafRefReferencingContext == null) {
return false;
}
}
public static boolean hasLeafRefChild(final SchemaNode node, final LeafRefContext root) {
-
if (node == null || root == null) {
return false;
}
- final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(
- node, root);
+ final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(node, root);
if (leafRefReferencingContext == null) {
return false;
}
return leafRefReferencingContext.hasReferencingChild();
}
- public static boolean isReferencedByLeafRef(final SchemaNode node,
- final LeafRefContext root) {
-
+ public static boolean isReferencedByLeafRef(final SchemaNode node, final LeafRefContext root) {
if (node == null || root == null) {
return false;
}
- final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(
- node, root);
+ final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(node, root);
if (leafRefReferencedByContext == null) {
return false;
}
return leafRefReferencedByContext.isReferenced();
}
- public static boolean hasChildReferencedByLeafRef(final SchemaNode node,
- final LeafRefContext root) {
-
- if ((node == null) || (root == null)) {
+ public static boolean hasChildReferencedByLeafRef(final SchemaNode node, final LeafRefContext root) {
+ if (node == null || root == null) {
return false;
}
- final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(
- node, root);
+ final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(node, root);
if (leafRefReferencedByContext == null) {
return false;
}
return leafRefReferencedByContext.hasReferencedChild();
}
- public static List<LeafRefContext> findAllLeafRefChilds(final SchemaNode node,
- final LeafRefContext root) {
-
+ public static List<LeafRefContext> findAllLeafRefChilds(final SchemaNode node, final LeafRefContext root) {
return findAllLeafRefChilds(node.getPath(), root);
}
- public static List<LeafRefContext> findAllLeafRefChilds(
- final SchemaPath schemaPath, final LeafRefContext root) {
-
+ public static List<LeafRefContext> findAllLeafRefChilds(final SchemaPath schemaPath, final LeafRefContext root) {
return findAllLeafRefChilds(schemaPath.getPathFromRoot(), root);
}
- public static List<LeafRefContext> findAllLeafRefChilds(
- final Iterable<QName> pathFromRoot, final LeafRefContext root) {
-
- final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(
- pathFromRoot, root);
+ public static List<LeafRefContext> findAllLeafRefChilds(final Iterable<QName> pathFromRoot,
+ final LeafRefContext root) {
+ final LeafRefContext leafRefReferencingContext = getLeafRefReferencingContext(pathFromRoot, root);
final List<LeafRefContext> allLeafRefsChilds = findAllLeafRefChilds(leafRefReferencingContext);
return allLeafRefsChilds;
}
- public static List<LeafRefContext> findAllLeafRefChilds(
- final LeafRefContext parent) {
-
+ public static List<LeafRefContext> findAllLeafRefChilds(final LeafRefContext parent) {
final LinkedList<LeafRefContext> leafRefChilds = new LinkedList<>();
-
if (parent == null) {
return leafRefChilds;
}
if (parent.isReferencing()) {
leafRefChilds.add(parent);
return leafRefChilds;
- } else {
- final Set<Entry<QName, LeafRefContext>> childs = parent
- .getReferencingChilds().entrySet();
- for (final Entry<QName, LeafRefContext> child : childs) {
- leafRefChilds.addAll(findAllLeafRefChilds(child.getValue()));
- }
+ }
+
+ final Set<Entry<QName, LeafRefContext>> childs = parent.getReferencingChilds().entrySet();
+ for (final Entry<QName, LeafRefContext> child : childs) {
+ leafRefChilds.addAll(findAllLeafRefChilds(child.getValue()));
}
return leafRefChilds;
}
- public static List<LeafRefContext> findAllChildsReferencedByLeafRef(
- final SchemaNode node, final LeafRefContext root) {
-
+ public static List<LeafRefContext> findAllChildsReferencedByLeafRef(final SchemaNode node,
+ final LeafRefContext root) {
return findAllChildsReferencedByLeafRef(node.getPath(), root);
}
- public static List<LeafRefContext> findAllChildsReferencedByLeafRef(
- final SchemaPath schemaPath, final LeafRefContext root) {
-
- return findAllChildsReferencedByLeafRef(schemaPath.getPathFromRoot(),
- root);
+ public static List<LeafRefContext> findAllChildsReferencedByLeafRef(final SchemaPath schemaPath,
+ final LeafRefContext root) {
+ return findAllChildsReferencedByLeafRef(schemaPath.getPathFromRoot(), root);
}
- public static List<LeafRefContext> findAllChildsReferencedByLeafRef(
- final Iterable<QName> pathFromRoot, final LeafRefContext root) {
+ public static List<LeafRefContext> findAllChildsReferencedByLeafRef(final Iterable<QName> pathFromRoot,
+ final LeafRefContext root) {
- final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(
- pathFromRoot, root);
- final List<LeafRefContext> allChildsReferencedByLeafRef = findAllChildsReferencedByLeafRef(leafRefReferencedByContext);
+ final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(pathFromRoot, root);
+ final List<LeafRefContext> allChildsReferencedByLeafRef =
+ findAllChildsReferencedByLeafRef(leafRefReferencedByContext);
return allChildsReferencedByLeafRef;
}
- public static List<LeafRefContext> findAllChildsReferencedByLeafRef(
- final LeafRefContext parent) {
-
+ public static List<LeafRefContext> findAllChildsReferencedByLeafRef(final LeafRefContext parent) {
final LinkedList<LeafRefContext> childsReferencedByLeafRef = new LinkedList<>();
-
if (parent == null) {
return childsReferencedByLeafRef;
}
if (parent.isReferenced()) {
childsReferencedByLeafRef.add(parent);
return childsReferencedByLeafRef;
- } else {
- final Set<Entry<QName, LeafRefContext>> childs = parent
- .getReferencedByChilds().entrySet();
- for (final Entry<QName, LeafRefContext> child : childs) {
- childsReferencedByLeafRef
- .addAll(findAllChildsReferencedByLeafRef(child
- .getValue()));
- }
+ }
+
+ final Set<Entry<QName, LeafRefContext>> childs = parent.getReferencedByChilds().entrySet();
+ for (final Entry<QName, LeafRefContext> child : childs) {
+ childsReferencedByLeafRef.addAll(findAllChildsReferencedByLeafRef(child.getValue()));
}
return childsReferencedByLeafRef;
}
return getAllLeafRefsReferencingThisNode(node.getPath(), root);
}
- public static Map<QName, LeafRefContext> getAllLeafRefsReferencingThisNode(
- final SchemaPath path, final LeafRefContext root) {
+ public static Map<QName, LeafRefContext> getAllLeafRefsReferencingThisNode(final SchemaPath path,
+ final LeafRefContext root) {
return getAllLeafRefsReferencingThisNode(path.getPathFromRoot(), root);
}
- public static Map<QName, LeafRefContext> getAllLeafRefsReferencingThisNode(
- final Iterable<QName> pathFromRoot, final LeafRefContext root) {
-
- final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(
- pathFromRoot, root);
+ public static Map<QName, LeafRefContext> getAllLeafRefsReferencingThisNode(final Iterable<QName> pathFromRoot,
+ final LeafRefContext root) {
+ final LeafRefContext leafRefReferencedByContext = getLeafRefReferencedByContext(pathFromRoot, root);
if (leafRefReferencedByContext == null) {
return new HashMap<>();
}
return leafRefReferencedByContext.getAllReferencedByLeafRefCtxs();
}
-
}