Examples of IJavaElementServiceBuilding


Examples of net.sourceforge.coffea.uml2.model.creation.IJavaElementServiceBuilding

      }
      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) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.