2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
10 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
11 import org.opendaylight.yangtools.yang.model.api.Status;
12 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
15 abstract class AbstractEffectiveDocumentedNode<A, D extends DeclaredStatement<A>>
16 extends DeclaredEffectiveStatementBase<A, D> implements DocumentedNode {
18 private final String description;
19 private final String reference;
20 private final Status status;
22 AbstractEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx) {
30 * context of statement.
31 * @param buildUnknownSubstatements
32 * if it is false, the unknown substatements are omitted from
33 * build of effective substatements till the call of either
34 * effectiveSubstatements or getOmittedUnknownSubstatements
35 * method of EffectiveStatementBase class. The main purpose of
36 * this is to allow the build of recursive extension definitions.
38 AbstractEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx, boolean buildUnknownSubstatements) {
39 super(ctx, buildUnknownSubstatements);
41 DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
42 if (descStmt != null) {
43 description = descStmt.argument();
48 ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
49 if (refStmt != null) {
50 reference = refStmt.argument();
52 RevisionEffectiveStatementImpl revision = firstEffective(RevisionEffectiveStatementImpl.class);
53 if (revision != null) {
54 reference = revision.getReference();
60 StatusEffectiveStatementImpl statusStmt = firstEffective(StatusEffectiveStatementImpl.class);
61 if (statusStmt != null) {
62 status = statusStmt.argument();
64 status = Status.CURRENT;
69 public final String getDescription() {
74 public final String getReference() {
79 public final Status getStatus() {