GroupingEffectiveStatementImpl( final StmtContext<QName, GroupingStatement, EffectiveStatement<QName, GroupingStatement>> ctx) { super(ctx); qname = ctx.coerceStatementArgument(); path = ctx.getSchemaPath().get(); addedByUses = ctx.getCopyHistory().contains(CopyType.ADDED_BY_USES); final ImmutableSet.Builder<ActionDefinition> actionsBuilder = ImmutableSet.builder(); final ImmutableSet.Builder<NotificationDefinition> notificationsBuilder = ImmutableSet.builder(); final ImmutableList.Builder<UnknownSchemaNode> b = ImmutableList.builder(); for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) { if (effectiveStatement instanceof ActionDefinition) { actionsBuilder.add((ActionDefinition) effectiveStatement); } if (effectiveStatement instanceof NotificationDefinition) { notificationsBuilder.add((NotificationDefinition) effectiveStatement); } if (effectiveStatement instanceof UnknownSchemaNode) { b.add((UnknownSchemaNode) effectiveStatement); } } this.actions = actionsBuilder.build(); this.notifications = notificationsBuilder.build(); unknownNodes = b.build(); }
ActionEffectiveStatementImpl( final StmtContext<QName, ActionStatement, EffectiveStatement<QName, ActionStatement>> ctx) { super(ctx); // initCopyType final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory(); if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.augmenting = true; this.addedByUses = true; } else { this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION); this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES); } }
final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory(); if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.augmenting = true;
protected AbstractEffectiveSimpleDataNodeContainer(final StmtContext<QName, D, ?> ctx) { super(ctx); this.path = ctx.getSchemaPath().get(); this.configuration = ctx.isConfiguration(); whenCondition = findFirstEffectiveSubstatementArgument(WhenEffectiveStatement.class).orElse(null); // initSubstatementCollectionsAndFields List<UnknownSchemaNode> unknownNodesInit = new ArrayList<>(); Set<AugmentationSchemaNode> augmentationsInit = new LinkedHashSet<>(); for (EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) { if (effectiveStatement instanceof UnknownSchemaNode) { unknownNodesInit.add((UnknownSchemaNode) effectiveStatement); } if (effectiveStatement instanceof AugmentationSchemaNode) { augmentationsInit.add((AugmentationSchemaNode) effectiveStatement); } } this.unknownNodes = ImmutableList.copyOf(unknownNodesInit); this.augmentations = ImmutableSet.copyOf(augmentationsInit); // initCopyType final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory(); if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.augmenting = true; this.addedByUses = true; } else { this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION); this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES); } }
addedByUses = ctx.getCopyHistory().contains(CopyType.ADDED_BY_USES);
protected AbstractEffectiveDataSchemaNode(final StmtContext<QName, D, ?> ctx) { super(ctx); this.configuration = ctx.isConfiguration(); whenCondition = findFirstEffectiveSubstatementArgument(WhenEffectiveStatement.class).orElse(null); // initCopyType final CopyHistory originalHistory = ctx.getCopyHistory(); if (originalHistory.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.augmenting = true; this.addedByUses = true; } else { this.augmenting = originalHistory.contains(CopyType.ADDED_BY_AUGMENTATION); this.addedByUses = originalHistory.contains(CopyType.ADDED_BY_USES); } }
final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory(); if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) { this.addedByAugmentation = true;
if (ctx.getCopyHistory().getLastOperation() == CopyType.ADDED_BY_AUGMENTATION) { final Optional<StmtContext<?, ?, ?>> optOrigCtx = ctx.getOriginalCtx(); if (optOrigCtx.isPresent()) {
qnameModule = StmtContextUtils.getRootModuleQName(ctx); if (qnameModule == null && ctx.getCopyHistory().getLastOperation() == CopyType.ADDED_BY_AUGMENTATION) { ctx = ctx.getOriginalCtx().orElse(null); qnameModule = StmtContextUtils.getModuleQNameByPrefix(ctx, prefix);