}
if (objective != null) {
String simpleName = ClassService
.simpleNameExtraction(objective);
IModelService model = getModelService();
IJavaElementServiceBuilding builder = null;
if (model != null) {
builder = model.getServiceBuilder();
}
if ((simpleName != null) && (simpleName.length() > 0)
&& (builder != null)) {
try {
String fileName =
simpleName
+
Resources.getCodeConstant(
"constants.javaSourceFileExtension"
);
String content = new String();
String fullName = getFullName();
if(
(fullName!=null)
&&(
!fullName.equals(
IModelService
.defaultPackageFileName
)
)
) {
content +=
Resources.getCodeConstant(
"constants.package"
)
+ ' '
+ getFullName()
+
Resources.getCodeConstant(
"constants.endStatement"
)
+
Resources.getCodeConstant(
"constants.newLine"
);
}
content += '\n' + "public class " + simpleName + '{';
content += '\n' + "}";
ICompilationUnit unit =
javaElement.createCompilationUnit(
fileName,
content,
true,
monitor
);
ITypeService<?, ?> tp =
builder.processTypeService(unit, monitor);
if (tp instanceof IClassService<?, ?>) {
result = (IClassService<?, ?>) tp;
addTypeService(result);
}
} catch (JavaModelException e) {