@Override public void startChoiceNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new choice node"); startNode(name.getNodeType(), NodeTypes.CHOICE_NODE); }
@Override public void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new map node"); startNode(name.getNodeType(), NodeTypes.MAP_NODE); }
@Override public void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new unkeyed list"); startNode(name.getNodeType(), NodeTypes.UNKEYED_LIST); }
@Override public DataNormalizationOperation<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public void startOrderedMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new ordered map node"); startNode(name.getNodeType(), NodeTypes.ORDERED_MAP_NODE); }
@Override public void leafNode(final NodeIdentifier name, final Object value) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Writing a new leaf node"); startNode(name.getNodeType(), NodeTypes.LEAF_NODE); writeObject(value); }
@Override public void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new ordered leaf set"); lastLeafSetQName = name.getNodeType(); startNode(name.getNodeType(), NodeTypes.ORDERED_LEAF_SET); }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerOp; } return null; } }
@Override public final void anyxmlNode(final NodeIdentifier name, final Object value) throws IOException { // FIXME: should have a codec based on this :) tracker.anyxmlNode(name); context.emittingChild(codecs.getSchemaContext(), writer); context.writeChildJsonIdentifier(codecs.getSchemaContext(), writer, name.getNodeType()); writeAnyXmlValue((DOMSource) value); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; } }
@Override public void anyxmlNode(final NodeIdentifier name, final Object value) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Writing a new xml node"); startNode(name.getNodeType(), NodeTypes.ANY_XML_NODE); writeObject(value); }
@Override public void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new container node"); startNode(name.getNodeType(), NodeTypes.CONTAINER_NODE); }
@Override public DataNormalizationOperation<?> getChild(final PathArgument child) { if (child.getNodeType().equals(getIdentifier().getNodeType())) { return innerNode; } return null; }
@Override public void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new container node"); startNode(name.getNodeType(), NodeTypes.CONTAINER_NODE); }
@Override public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue, final Map<QName, String> attributes) { final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create(); b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue)); b.withValue(childValue); b.withAttributes(attributes); return withChild(b.build()); }
@Override public DataSchemaContextNode<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.debug("Starting a new leaf set"); lastLeafSetQName = name.getNodeType(); startNode(name.getNodeType(), NodeTypes.LEAF_SET); }
@Override public DataNormalizationOperation<?> getChild(final QName child) { if (getIdentifier().getNodeType().equals(child)) { return innerNode; } return null; }
@Override public void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException { Preconditions.checkNotNull(name, "Node identifier should not be null"); LOG.trace("Starting a new leaf set"); lastLeafSetQName = name.getNodeType(); startNode(name.getNodeType(), NodeTypes.LEAF_SET); }