IPackageFragment factoryPackageFragment = getPackage(root, clientFactoryPackageName);
ICompilationUnit factoryUnit =
factoryPackageFragment.getCompilationUnit(clientFactoryClassName + ".java");
AstEditor editor = new AstEditor(factoryUnit);
TypeDeclaration factoryPrimaryType = editor.getPrimaryType();
BodyDeclarationTarget bodyDeclarationTarget =
new BodyDeclarationTarget(factoryPrimaryType, false);
// modifying ...
MethodDeclaration methodDeclaration;
if (factoryPrimaryType.isInterface()) {
// interface
String methodHeader = "public " + methodSignature + ";";