/* * Copyright (c) 2019 PANTHEON.tech s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.data.impl.schema; import com.google.common.annotations.Beta; import java.io.IOException; import org.opendaylight.yangtools.rcf8528.data.util.EmptyMountPointContext; import org.opendaylight.yangtools.rfc8528.data.api.MountPointChild; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; /** * Utility base class for implementing {@link MountPointChild} classes. */ @Beta public abstract class AbstractMountPointChild implements MountPointChild { @Override public final NormalizedNode normalizeTo(final EffectiveModelContext schemaContext) throws IOException { final NormalizedNodeResult result = new NormalizedNodeResult(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); writeTo(streamWriter, new EmptyMountPointContext(schemaContext)); return result.getResult(); } }