return JavaTypeName.make (fti.getForeignType());
}
TypeConstructor typeConstructor = typeConsApp.getRoot();
JavaTypeName typeName = (JavaTypeName)typeToClassMappings.get(typeConstructor.getName());
if (typeName != null) {
return typeName;
}
String unqualifiedTypeConstructorName = typeConstructor.getName().getUnqualifiedName();
if (unqualifiedTypeConstructorName.equals("Function")) {
return CAL_VALUE;
}
// We are going to build up a JavaTypeName based on our naming convention for generated
// I/O classes.
// Check to see if the CAL module is mapped to a Java package.
String referencedPackage = moduleToPackageMappings.get(typeConstructor.getName().getModuleName());
if (referencedPackage == null) {
// If not use the target package.
referencedPackage = targetPackage;
}
if (referencedPackage.endsWith(".")) {
referencedPackage = referencedPackage.substring(0, referencedPackage.lastIndexOf('.'));
}
if (referencedPackage.lastIndexOf('.') > 0) {
referencedPackage = referencedPackage.substring(0, referencedPackage.lastIndexOf('.')+1);
} else {
referencedPackage = referencedPackage + ".";
}
// Create a Java class name.
JavaTypeName typeConstructorClassName =
JavaTypeName.make(referencedPackage + typeConstructor.getName().getModuleName().getLastComponent() + "." + getClassName(typeConstructor), false);
return typeConstructorClassName;
}
}