2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 * and is available at http://www.eclipse.org/legal/epl-v10.html
7 package org.opendaylight.yangtools.yang.parser.builder.api;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
13 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
14 import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
15 import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
18 * Interface for builders of 'typedef' statement.
20 public interface TypeDefinitionBuilder extends TypeAwareBuilder, SchemaNodeBuilder, GroupingMember {
23 * Sets QName for resulting type definition.
25 * @param qname QName of resulting type
27 void setQName(QName qname);
30 TypeDefinition<?> build();
34 * Returns range restrictions of resulting type definition.
36 * @return range restrictions of resulting type definition.
38 List<RangeConstraint> getRanges();
41 * Set Range restrictions for resulting type definition.
44 * Range restrictions of resulting type definition.
46 void setRanges(List<RangeConstraint> ranges);
50 * Returns length restrictions of resulting type definition.
52 * @return length restrictions of resulting type definition.
54 List<LengthConstraint> getLengths();
57 * Set length restrictions for resulting type definition.
60 * Length restrictions of resulting type definition.
62 void setLengths(List<LengthConstraint> lengths);
66 * Returns pattern restrictions of resulting type definition.
68 * @return range restrictions of resulting type definition.
70 List<PatternConstraint> getPatterns();
73 * Set length restrictions for resulting type definition.
76 * Length restrictions of resulting type definition.
78 void setPatterns(List<PatternConstraint> patterns);
82 * Returns fractions digits of resulting type if it is derived
83 * from <code>decimal</code> built-in type.
85 * @return fractions digits of resulting type
87 Integer getFractionDigits();
91 * Sets fractions digits of resulting type if it is derived
92 * from <code>decimal</code> built-in type.
94 * @return fractions digits of resulting type
96 void setFractionDigits(Integer fractionDigits);
100 * Returns default value of resulting type
102 * @return default value of resulting type
104 Object getDefaultValue();
108 * Sets default value of resulting type
110 * @param defaultValue Default value of resulting type
112 void setDefaultValue(Object defaultValue);
115 * Gets unit definition for resulting type
117 * @return unit definition for resulting type
122 * Sets units definition for resulting type
124 * @param units units definition for resulting type
126 void setUnits(String units);