Search in sources :

Example 1 with NormalizedNodeBuilder

use of org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder in project yangtools by opendaylight.

the class ImmutableNormalizedNodeStreamWriter method currentScalar.

@SuppressWarnings("rawtypes")
private NormalizedNodeBuilder currentScalar() {
    final NormalizedNodeBuilder current = current();
    checkState(!(current instanceof NormalizedNodeContainerBuilder), "Unexpected node container %s", current);
    return current;
}
Also used : NormalizedNodeBuilder(org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder) NormalizedNodeContainerBuilder(org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeContainerBuilder)

Example 2 with NormalizedNodeBuilder

use of org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder in project yangtools by opendaylight.

the class ImmutableNormalizedNodeStreamWriter method endNode.

@Override
@SuppressWarnings("rawtypes")
public void endNode() {
    final NormalizedNodeBuilder finishedBuilder = builders.poll();
    checkState(finishedBuilder != null, "Node which should be closed does not exists.");
    final NormalizedNode product = finishedBuilder.build();
    nextSchema = null;
    writeChild(product);
}
Also used : NormalizedNodeBuilder(org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)

Example 3 with NormalizedNodeBuilder

use of org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder in project yangtools by opendaylight.

the class ImmutableNormalizedNodeStreamWriter method currentContainer.

@SuppressWarnings("rawtypes")
private NormalizedNodeContainerBuilder currentContainer() {
    final NormalizedNodeBuilder current = current();
    if (current == null) {
        return null;
    }
    checkState(current instanceof NormalizedNodeContainerBuilder, "%s is not a node container", current);
    return (NormalizedNodeContainerBuilder) current;
}
Also used : NormalizedNodeBuilder(org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder) NormalizedNodeContainerBuilder(org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeContainerBuilder)

Aggregations

NormalizedNodeBuilder (org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeBuilder)3 NormalizedNodeContainerBuilder (org.opendaylight.yangtools.yang.data.api.schema.builder.NormalizedNodeContainerBuilder)2 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)1