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;
10 import java.util.List;
12 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.ErrorAppTagStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.ErrorMessageStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.LengthStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
19 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
21 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
22 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
23 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
25 public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthConstraint>> implements LengthStatement {
27 protected LengthStatementImpl(StmtContext<List<LengthConstraint>, LengthStatement, ?> context) {
31 public static class Definition
33 AbstractStatementSupport<List<LengthConstraint>, LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> {
36 super(Rfc6020Mapping.LENGTH);
40 public List<LengthConstraint> parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
41 return TypeUtils.parseLengthListFromString(value);
45 public LengthStatement createDeclared(StmtContext<List<LengthConstraint>, LengthStatement, ?> ctx) {
46 return new LengthStatementImpl(ctx);
50 public EffectiveStatement<List<LengthConstraint>, LengthStatement> createEffective(
51 StmtContext<List<LengthConstraint>, LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> ctx) {
52 return new LengthEffectiveStatementImpl(ctx);
57 public ErrorAppTagStatement getErrorAppTagStatement() {
58 return firstDeclared(ErrorAppTagStatement.class);
62 public ErrorMessageStatement getErrorMessageStatement() {
63 return firstDeclared(ErrorMessageStatement.class);
67 public DescriptionStatement getDescription() {
68 return firstDeclared(DescriptionStatement.class);
72 public ReferenceStatement getReference() {
73 return firstDeclared(ReferenceStatement.class);
77 public List<LengthConstraint> getValue() {