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;
10 import org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
12 import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
13 import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
14 import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
17 * Interface for builders of 'typedef' statement.
19 public interface TypeDefinitionBuilder extends TypeAwareBuilder, SchemaNodeBuilder, GroupingMember {
22 * Sets QName for resulting type definition.
24 * @param qname QName of resulting type
26 void setQName(QName qname);
29 TypeDefinition<?> build();
33 * Returns range restrictions of resulting type definition.
35 * @return range restrictions of resulting type definition.
37 List<RangeConstraint> getRanges();
40 * Set Range restrictions for resulting type definition.
43 * Range restrictions of resulting type definition.
45 void setRanges(List<RangeConstraint> ranges);
49 * Returns length restrictions of resulting type definition.
51 * @return length restrictions of resulting type definition.
53 List<LengthConstraint> getLengths();
56 * Set length restrictions for resulting type definition.
59 * Length restrictions of resulting type definition.
61 void setLengths(List<LengthConstraint> lengths);
65 * Returns pattern restrictions of resulting type definition.
67 * @return range restrictions of resulting type definition.
69 List<PatternConstraint> getPatterns();
72 * Set pattern restrictions for resulting type definition.
75 * patterns restrictions of resulting type definition.
77 void setPatterns(List<PatternConstraint> patterns);
81 * Returns fractions digits of resulting type if it is derived
82 * from <code>decimal</code> built-in type.
84 * @return fractions digits of resulting type
86 Integer getFractionDigits();
89 * Sets fractions digits of resulting type if it is derived from
90 * <code>decimal</code> built-in type.
92 void setFractionDigits(Integer fractionDigits);
96 * Returns default value of resulting type
98 * @return default value of resulting type
100 Object getDefaultValue();
104 * Sets default value of resulting type
106 * @param defaultValue Default value of resulting type
108 void setDefaultValue(Object defaultValue);
111 * Gets unit definition for resulting type
113 * @return unit definition for resulting type
118 * Sets units definition for resulting type
120 * @param units units definition for resulting type
122 void setUnits(String units);