Added line number to error messages.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / model / parser / builder / api / AbstractTypeAwareBuilder.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.yang.model.parser.builder.api;
9
10 import org.opendaylight.controller.yang.model.api.TypeDefinition;
11
12 /**
13  * Basic implementation for TypeAwareBuilder builders.
14  */
15 public abstract class AbstractTypeAwareBuilder implements TypeAwareBuilder {
16
17     protected TypeDefinition<?> type;
18     protected TypeDefinitionBuilder typedef;
19
20     @Override
21     public TypeDefinition<?> getType() {
22         return type;
23     }
24
25     @Override
26     public TypeDefinitionBuilder getTypedef() {
27         return typedef;
28     }
29
30     @Override
31     public void setType(TypeDefinition<?> type) {
32         this.type = type;
33         this.typedef = null;
34     }
35
36     @Override
37     public void setType(TypeDefinitionBuilder typedef) {
38         this.typedef = typedef;
39         this.type = null;
40     }
41
42 }