--- /dev/null
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.controller.sal.binding.yang.types;\r
+\r
+import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider;\r
+import org.opendaylight.controller.sal.binding.model.api.Type;\r
+import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
+\r
+public class TypeProviderImpl implements TypeProvider {\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ * \r
+ * @see org.opendaylight.controller.yang.model.type.provider.TypeProvider#\r
+ * javaTypeForYangType(java.lang.String)\r
+ */\r
+ @Override\r
+ public Type javaTypeForYangType(String type) {\r
+ Type t = BaseYangTypes.BASE_YANG_TYPES_PROVIDER\r
+ .javaTypeForYangType(type);\r
+ // TODO: this needs to be implemented in better way\r
+ // if(t == null) {\r
+ // t = BaseYangTypes.IETF_INET_TYPES_PROVIDER.javaTypeForYangType(type);\r
+ // }\r
+ return t;\r
+ }\r
+\r
+ @Override\r
+ public Type javaTypeForSchemaDefinitionType(final TypeDefinition<?> type) {\r
+ if (type != null) {\r
+ Type t = BaseYangTypes.BASE_YANG_TYPES_PROVIDER\r
+ .javaTypeForSchemaDefinitionType(type);\r
+\r
+ if (t != null) {\r
+ return t;\r
+ }\r
+ }\r
+ return null;\r
+ }\r
+}\r