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;
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.LengthStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.PatternStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
21 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.StringRestrictionsEffectiveStatementImpl;
23 public class StringRestrictionsImpl extends AbstractDeclaredStatement<String> implements
24 TypeStatement.StringRestrictions {
26 protected StringRestrictionsImpl(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) throws SourceException {
44 public TypeStatement.StringRestrictions createDeclared(
45 StmtContext<String, TypeStatement.StringRestrictions, ?> ctx) {
46 return new StringRestrictionsImpl(ctx);
50 public EffectiveStatement<String, TypeStatement.StringRestrictions> createEffective(
51 StmtContext<String, TypeStatement.StringRestrictions, EffectiveStatement<String, TypeStatement.StringRestrictions>> ctx) {
52 return new StringRestrictionsEffectiveStatementImpl(ctx);
57 public String getName() {
62 public LengthStatement getLength() {
63 return firstDeclared(LengthStatement.class);
67 public Collection<? extends PatternStatement> getPatterns() {
68 return allDeclared(PatternStatement.class);