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 public 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 protected 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 protected AbstractEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx, boolean buildUnknownSubstatements) {
39 super(ctx, buildUnknownSubstatements);
41 final DescriptionEffectiveStatementImpl descStmt = firstEffective(DescriptionEffectiveStatementImpl.class);
42 if (descStmt != null) {
43 description = descStmt.argument();
48 final ReferenceEffectiveStatementImpl refStmt = firstEffective(ReferenceEffectiveStatementImpl.class);
49 if (refStmt != null) {
50 reference = refStmt.argument();
55 final StatusEffectiveStatementImpl statusStmt = firstEffective(StatusEffectiveStatementImpl.class);
56 if (statusStmt != null) {
57 status = statusStmt.argument();
59 status = Status.CURRENT;
64 public final String getDescription() {
69 public final String getReference() {
74 public final Status getStatus() {