public Optional<StatementSupport<?, ?, ?>> getImplicitParentFor(final StatementDefinition stmtDef) { return support.getImplicitParentFor(stmtDef); }
boolean hasArgumentSpecificSubDefinitions() { return support.hasArgumentSpecificSupports(); }
public void onDeclarationFinished(final Mutable<A, D, E> statement, final ModelProcessingPhase phase) { switch (phase) { case SOURCE_PRE_LINKAGE: support.onPreLinkageDeclared(statement); break; case SOURCE_LINKAGE: support.onLinkageDeclared(statement); break; case STATEMENT_DEFINITION: support.onStatementDefinitionDeclared(statement); break; case FULL_DECLARATION: support.onFullDefinitionDeclared(statement); break; default: break; } }
@Override default boolean isArgumentYinElement() { return getPublicView().isArgumentYinElement(); } }
public Builder addSupport(final StatementSupport<?, ?, ?> support) { final QName identifier = support.getStatementName(); checkNoParentDefinition(identifier); checkState(!commonStatements.containsKey(identifier), "Statement %s already defined in common statement bundle.", identifier); commonStatements.put(identifier, support); return this; }
@Override public E createEffective(final StmtContext<A, D, E> ctx) { return delegate().createEffective(ctx); }
@Override public StatementSupport<?, ?, ?> getSupportSpecificForArgument(final String argument) { return delegate().getSupportSpecificForArgument(argument); } }
public boolean onStatementAdded(final Mutable<A, D, E> stmt) { support.onStatementAdded(stmt); return false; }
@Override public void onFullDefinitionDeclared(final Mutable<A, D, E> stmt) { delegate().onFullDefinitionDeclared(stmt); }
@Override public void onPreLinkageDeclared(final Mutable<A, D, E> stmt) { delegate().onPreLinkageDeclared(stmt); }
@Override public void onLinkageDeclared(final Mutable<A, D, E> stmt) { delegate().onLinkageDeclared(stmt); }
@Override default QName getArgumentName() { return getPublicView().getArgumentName(); }
public @NonNull QName getStatementName() { return support.getStatementName(); }
@Override public AnyxmlEffectiveStatement createEffective( final StmtContext<QName, AnyxmlStatement, AnyxmlEffectiveStatement> ctx) { final AnyxmlEffectiveStatement delegateStatement = delegate().createEffective(ctx); final Map<StatementDefinition, Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>>> schemaLocations = ctx.getAllFromCurrentStmtCtxNamespace(AnyxmlSchemaLocationNamespace.class); if (schemaLocations != null && !schemaLocations.isEmpty()) { final SchemaNodeIdentifier anyXmlSchemaNodeIdentifier = schemaLocations.values().iterator().next() .getStatementArgument(); final Optional<ContainerSchemaNode> anyXmlSchema = getAnyXmlSchema(ctx, anyXmlSchemaNodeIdentifier); if (anyXmlSchema.isPresent()) { return new YangModeledAnyxmlEffectiveStatementImpl(delegateStatement, anyXmlSchema.get()); } } return delegateStatement; }
@NonNull StatementDefinitionContext<?, ?, ?> getSubDefinitionSpecificForArgument(final String argument) { if (!hasArgumentSpecificSubDefinitions()) { return this; } StatementDefinitionContext<?, ?, ?> potential = argumentSpecificSubDefinitions.get(argument); if (potential == null) { final StatementSupport<?, ?, ?> argumentSpecificSupport = support.getSupportSpecificForArgument(argument); potential = argumentSpecificSupport != null ? new StatementDefinitionContext<>(argumentSpecificSupport) : this; argumentSpecificSubDefinitions.put(argument, potential); } return potential; }
@Override public void onStatementAdded(final Mutable<A, D, E> stmt) { delegate().onStatementAdded(stmt); }
@Override default Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass() { return getPublicView().getDeclaredRepresentationClass(); }
public Builder overrideSupport(final StatementSupport<?, ?, ?> support) { final QName identifier = support.getStatementName(); checkNoParentDefinition(identifier); final StatementSupport<?, ?, ?> previousSupport = commonStatements.replace(identifier, support); checkState(previousSupport != null, "Statement %s was not previously defined", identifier); LOG.debug("Changed statement {} support from {} to {}", identifier, previousSupport, support); return this; }
public StatementDefinitionContext(final StatementSupport<A, D, E> support) { this.support = requireNonNull(support); this.argumentSpecificSubDefinitions = support.hasArgumentSpecificSupports() ? new HashMap<>() : null; }
@Override public AnyxmlEffectiveStatement createEffective( final StmtContext<QName, AnyxmlStatement, AnyxmlEffectiveStatement> ctx) { final AnyxmlEffectiveStatement delegateStatement = delegate().createEffective(ctx); final Map<StatementDefinition, Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>>> schemaLocations = ctx.getAllFromCurrentStmtCtxNamespace(AnyxmlSchemaLocationNamespace.class); if (schemaLocations != null && !schemaLocations.isEmpty()) { final SchemaNodeIdentifier anyXmlSchemaNodeIdentifier = schemaLocations.values().iterator().next() .getStatementArgument(); final Optional<ContainerSchemaNode> anyXmlSchema = getAnyXmlSchema(ctx, anyXmlSchemaNodeIdentifier); if (anyXmlSchema.isPresent()) { return new YangModeledAnyxmlEffectiveStatementImpl(delegateStatement, anyXmlSchema.get()); } } return delegateStatement; }