String typeName) {\r
TypeDefinition<?> type = null;\r
\r
- SchemaPath path = createSchemaPath(actualPath, namespace, revision);\r
+ SchemaPath path = createSchemaPath(actualPath, namespace, revision, typeName);\r
if (typeName.startsWith("int")) {\r
- if (typeName.equals("int8")) {\r
+ if ("int8".equals(typeName)) {\r
type = new Int8(path);\r
- } else if (typeName.equals("int16")) {\r
+ } else if ("int16".equals(typeName)) {\r
type = new Int16(path);\r
- } else if (typeName.equals("int32")) {\r
+ } else if ("int32".equals(typeName)) {\r
type = new Int32(path);\r
- } else if (typeName.equals("int64")) {\r
+ } else if ("int64".equals(typeName)) {\r
type = new Int64(path);\r
}\r
} else if (typeName.startsWith("uint")) {\r
- if (typeName.equals("uint8")) {\r
+ if ("uint8".equals(typeName)) {\r
type = new Uint8(path);\r
- } else if (typeName.equals("uint16")) {\r
+ } else if ("uint16".equals(typeName)) {\r
type = new Uint16(path);\r
- } else if (typeName.equals("uint32")) {\r
+ } else if ("uint32".equals(typeName)) {\r
type = new Uint32(path);\r
- } else if (typeName.equals("uint64")) {\r
+ } else if ("uint64".equals(typeName)) {\r
type = new Uint64(path);\r
}\r
} else if ("string".equals(typeName)) {\r
return type;\r
}\r
\r
- private static SchemaPath createSchemaPath(List<String> actualPath, URI namespace, Date revision) {\r
+ private static SchemaPath createSchemaPath(List<String> actualPath, URI namespace, Date revision, String typeName) {\r
+ List<String> correctPath = new ArrayList<String>(actualPath);\r
+ // remove module name\r
+ correctPath.remove(0);\r
+\r
List<QName> path = new ArrayList<QName>();\r
- for(String element : actualPath) {\r
+ for(String element : correctPath) {\r
path.add(new QName(namespace, revision, element));\r
}\r
+ // add type qname\r
+ QName typeQName = new QName(BaseTypes.BaseTypesNamespace, typeName);\r
+ path.add(typeQName);\r
return new SchemaPath(path, true);\r
}\r
\r