*/
public static JavaType resolveType(JDOModel jdoModel, String typeName,
String packagePrefix)
{
JavaType type = null;
JavaModel javaModel = jdoModel.getJavaModel();
if (primitiveTypeNames.contains(typeName) ||
(typeName.indexOf('.') != -1) ||
(packagePrefix == null) || (packagePrefix.length() == 0)) {
// Take the typeName as specified,
// if typeName denotes a primitive type or is a qualified name
// or if there is no packagePrefix (default package)
type = javaModel.getJavaType(typeName);
}
else {
// Not a primitive type and not qualified and packagePrefix
// specified => qualify using packagePrefix
type = javaModel.getJavaType(packagePrefix + typeName);
if (type == null) {
// If type could not be resolved =>
// use java.lang. package prefix as qualifier
type = javaModel.getJavaType("java.lang." + typeName); //NOI18N
}
}
return type;
}