コード例 #1
0
 private IPackage createPackage(Type type) throws InvalidEditingException {
   if (type.getNamespaceClass() == null || isEmpty(type.getNamespaceClass().namespace)) {
     return this.project;
   }
   String[] namespaces = type.getNamespaceClass().namespace.split("::");
   IPackage parentModel = this.project;
   for (String ns : namespaces) {
     IPackage pkg;
     if ((pkg = this.getNamespace(parentModel, ns)) == null) {
       parentModel = this.basicModelEditor.createPackage(parentModel, ns);
       LOG.trace(format("create model : %s", parentModel.getFullName("::")));
     } else {
       LOG.debug(String.format("%s is exits.", pkg.getFullName("::")));
       parentModel = pkg;
     }
   }
   return parentModel;
 }
コード例 #2
0
 public void createNamespace(IModel model, CompounddefType compounddefType)
     throws InvalidEditingException {
   if (compounddefType.getKind() == DoxCompoundKind.NAMESPACE) {
     String[] namespaces = compounddefType.getCompoundname().split("::");
     IPackage parentModel = model;
     for (String namespace : namespaces) {
       IPackage pkg;
       if ((pkg = this.getNamespace(parentModel, namespace)) == null) {
         // 無名名前空間で、doxygenの設定で表示しない場合(@から始まるパッケージ)は作成しない。
         if (!namespace.startsWith("@")) {
           parentModel = this.basicModelEditor.createPackage(parentModel, namespace);
           LOG.trace(format("create model : %s", parentModel.getFullName("::")));
           // パッケージ内のenumを作成する
           this.createEnum(compounddefType, parentModel);
         }
       } else {
         LOG.debug(String.format("%s is exits.", pkg.getFullName("::")));
         parentModel = pkg;
       }
     }
   }
 }