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;
22 public class StringRestrictionsImpl extends AbstractDeclaredStatement<String>
23 implements TypeStatement.StringRestrictions {
25 protected StringRestrictionsImpl(
26 StmtContext<String, TypeStatement.StringRestrictions, ?> context) {
30 public static class Definition
32 AbstractStatementSupport<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> {
35 super(Rfc6020Mapping.TYPE);
39 public String parseArgumentValue(StmtContext<?, ?, ?> ctx, String value)
40 throws SourceException {
45 public TypeStatement.StringRestrictions createDeclared(
46 StmtContext<String, TypeStatement.StringRestrictions, ?> ctx) {
47 return new StringRestrictionsImpl(ctx);
51 public EffectiveStatement<String, TypeStatement.StringRestrictions> createEffective(
52 StmtContext<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> ctx) {
53 throw new UnsupportedOperationException();
58 public String getName() {
63 public LengthStatement getLength() {
64 return firstDeclared(LengthStatement.class);
68 public Collection<? extends PatternStatement> getPatterns() {
69 return allDeclared(PatternStatement.class);