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.Collection;
11 import org.opendaylight.yangtools.yang.model.api.stmt.LengthStatement;
12 import org.opendaylight.yangtools.yang.model.api.stmt.PatternStatement;
14 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
18 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
19 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
20 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
21 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.StringRestrictionsEffectiveStatementImpl;
23 public class StringRestrictionsImpl extends AbstractDeclaredStatement<String>
24 implements TypeStatement.StringRestrictions {
26 protected StringRestrictionsImpl(
27 StmtContext<String, TypeStatement.StringRestrictions, ?> context) {
31 public static class Definition
33 AbstractStatementSupport<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> {
36 super(Rfc6020Mapping.TYPE);
40 public String parseArgumentValue(StmtContext<?, ?, ?> ctx, String value)
41 throws SourceException {
46 public TypeStatement.StringRestrictions createDeclared(
47 StmtContext<String, TypeStatement.StringRestrictions, ?> ctx) {
48 return new StringRestrictionsImpl(ctx);
52 public EffectiveStatement<String, TypeStatement.StringRestrictions> createEffective(
53 StmtContext<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> ctx) {
54 return new StringRestrictionsEffectiveStatementImpl(ctx);
59 public String getName() {
64 public LengthStatement getLength() {
65 return firstDeclared(LengthStatement.class);
69 public Collection<? extends PatternStatement> getPatterns() {
70 return allDeclared(PatternStatement.class);