private static void copyStatement(final Mutable<?, ?, ?> original, final StatementContextBase<?, ?, ?> targetCtx, final QNameModule targetModule, final Collection<Mutable<?, ?, ?>> buffer) { if (needToCopyByUses(original)) { final Mutable<?, ?, ?> copy = targetCtx.childCopyOf(original, CopyType.ADDED_BY_USES, targetModule); buffer.add(copy); } else if (isReusedByUsesOnTop(original)) { buffer.add(original); } }
private static void copyStatement(final Mutable<?, ?, ?> original, final StatementContextBase<?, ?, ?> target, final CopyType typeOfCopy, final Collection<Mutable<?, ?, ?>> buffer, final boolean skipCheckOfMandatoryNodes) { if (needToCopyByAugment(original)) { validateNodeCanBeCopiedByAugment(original, target, typeOfCopy, skipCheckOfMandatoryNodes); buffer.add(target.childCopyOf(original, typeOfCopy)); } else if (isReusedByAugment(original)) { buffer.add(original); } }
private static void copyStatement(final Mutable<?, ?, ?> stmtCtxToBeCopied, final StatementContextBase<?, ?, ?> targetCtx) { // we need to make a copy of the statement context only if it is an unknown statement, otherwise // we can reuse the original statement context if (!StmtContextUtils.isUnknownStatement(stmtCtxToBeCopied)) { targetCtx.addEffectiveSubstatement(stmtCtxToBeCopied); } else { targetCtx.addEffectiveSubstatement(targetCtx.childCopyOf(stmtCtxToBeCopied, CopyType.ORIGINAL)); } }