我在intellij中创建uml类时遇到了一个syntex错误,如何修复它?

ha5z0ras  于 2021-06-30  发布在  Java
关注(0)|答案(1)|浏览(540)

我正在用intellij制作一个uml类图,上面写着“sketch it!”插件,但它说在第5行有一个语法错误,它第一次说的是名称空间。我不明白为什么,因为它说同样的多次以及下面没有一个错误。我在网上找不到这个程序的教程,所以我很难修复它。

@startuml

title __STREAMINGSERVICE's Class Diagram__\n

  namespace  {    \\   <--- this is where I get the syntax error!!
    class ChangeLoginGUI {
    }
  }

  namespace  {
    class Episode {
    }
  }

  namespace  {
    class EpisodeGUI {
    }
  }

  namespace  {
    class FileReader {
    }
  }

  namespace  {
    class IncorrectLoginException {
    }
  }

  namespace  {
    class InfoGUI {
    }
  }

  namespace  {
    class InfoSGUI {
    }
  }

  namespace  {
    abstract class InfoSuper {
    }
  }

  namespace  {
    class LoginGUI {
    }
  }

  namespace  {
    class Main {
    }
  }

  namespace  {
    class MainGUI {
    }
  }

  namespace  {
    abstract class Media {
    }
  }

  namespace  {
    class MediaLibrary {
    }
  }

  namespace  {
    class MediaPlayer {
    }
  }

  namespace  {
    class Movie {
    }
  }

  namespace  {
    class MovieGenerator {
    }
  }

  namespace  {
    class MovieGeneratorTest {
    }
  }

  namespace  {
    class NotificationGUI {
    }
  }

  namespace  {
    abstract class ObjectGenerator {
    }
  }

  namespace  {
    interface Playable {
    }
  }

  namespace  {
    class SearchEngine {
    }
  }

  namespace  {
    class SearchEngineTest {
    }
  }

  namespace  {
    class Series {
    }
  }

  namespace  {
    class SeriesGenerator {
    }
  }

  namespace  {
    class SeriesGeneratorTest {
    }
  }

  namespace  {
    class User {
    }
  }

  namespace  {
    class UserList {
    }
  }

  ChangeLoginGUI -up-|> javax.swing.JFrame
  ChangeLoginGUI o-- User : user
  ChangeLoginGUI o-- UserList : userList
  Episode .up.|> Playable
  EpisodeGUI -up-|> javax.swing.JFrame
  EpisodeGUI o-- MediaPlayer : play
  EpisodeGUI o-- Series : media
  EpisodeGUI o-- MediaLibrary : ml
  EpisodeGUI o-- User : user
  InfoGUI -up-|> InfoSuper
  InfoSGUI -up-|> InfoSuper
  InfoSuper -up-|> javax.swing.JFrame
  InfoSuper o-- Media : media
  InfoSuper o-- MediaPlayer : play
  InfoSuper o-- User : user
  LoginGUI -up-|> javax.swing.JFrame
  LoginGUI o-- MainGUI : launchProgram
  LoginGUI o-- UserList : userList
  MainGUI -up-|> javax.swing.JFrame
  MainGUI o-- MediaLibrary : mediaLibrary
  MainGUI o-- SearchEngine : searchEngine
  MainGUI o-- User : user
  MediaLibrary o-- SeriesGenerator : m1
  MediaLibrary o-- MovieGenerator : m2
  MediaPlayer -up-|> javax.swing.JFrame
  Movie .up.|> Playable
  Movie -up-|> Media
  MovieGenerator -up-|> ObjectGenerator
  MovieGeneratorTest o-- FileReader : fr
  MovieGeneratorTest o-- MovieGenerator : mg
  MovieGeneratorTest o-- MovieGeneratorTest : mgt
  ObjectGenerator o-- FileReader : fr
  SearchEngine o-- MediaLibrary : mediaLibrary
  SearchEngineTest o-- SearchEngine : searchEngine
  Series -up-|> Media
  SeriesGenerator -up-|> ObjectGenerator
  SeriesGeneratorTest o-- FileReader : fr
  SeriesGeneratorTest o-- SeriesGenerator : sg

right footer

PlantUML diagram generated by SketchIt! (https://bitbucket.org/pmesmeur/sketch.it)
For more information about this tool, please contact philippe.mesmeur@gmail.com
endfooter

@enduml
olqngx59

olqngx591#

该定义与plantuml语法不兼容 namespace {..} 不命名名称空间和这些 {} 介绍完每节课
将前两个类放置在专用命名空间中,而不是下一个:

@startuml

title __STREAMINGSERVICE's Class Diagram__\n

namespace A {    
     class ChangeLoginGUI 
}

  namespace B {
     class Episode
  }

  class   EpisodeGUI

   class  FileReader

   class  IncorrectLoginException

    class InfoGUI

    class InfoSGUI 

    abstract class InfoSuper

    class LoginGUI

    class Main

    class MainGUI 

    abstract class Media

    class MediaLibrary 

    class MediaPlayer

    class Movie

    class MovieGenerator 

    class MovieGeneratorTest

    class NotificationGUI

    abstract class ObjectGenerator

    interface Playable

    class SearchEngine 

    class SearchEngineTest

    class Series

    class SeriesGenerator

    class SeriesGeneratorTest

    class User 

    class UserList

  ChangeLoginGUI -up-|> javax.swing.JFrame
  ChangeLoginGUI o-- User : user
  ChangeLoginGUI o-- UserList : userList
  Episode .up.|> Playable
  EpisodeGUI -up-|> javax.swing.JFrame
  EpisodeGUI o-- MediaPlayer : play
  EpisodeGUI o-- Series : media
  EpisodeGUI o-- MediaLibrary : ml
  EpisodeGUI o-- User : user
  InfoGUI -up-|> InfoSuper
  InfoSGUI -up-|> InfoSuper
  InfoSuper -up-|> javax.swing.JFrame
  InfoSuper o-- Media : media
  InfoSuper o-- MediaPlayer : play
  InfoSuper o-- User : user
  LoginGUI -up-|> javax.swing.JFrame
  LoginGUI o-- MainGUI : launchProgram
  LoginGUI o-- UserList : userList
  MainGUI -up-|> javax.swing.JFrame
  MainGUI o-- MediaLibrary : mediaLibrary
  MainGUI o-- SearchEngine : searchEngine
  MainGUI o-- User : user
  MediaLibrary o-- SeriesGenerator : m1
  MediaLibrary o-- MovieGenerator : m2
  MediaPlayer -up-|> javax.swing.JFrame
  Movie .up.|> Playable
  Movie -up-|> Media
  MovieGenerator -up-|> ObjectGenerator
  MovieGeneratorTest o-- FileReader : fr
  MovieGeneratorTest o-- MovieGenerator : mg
  MovieGeneratorTest o-- MovieGeneratorTest : mgt
  ObjectGenerator o-- FileReader : fr
  SearchEngine o-- MediaLibrary : mediaLibrary
  SearchEngineTest o-- SearchEngine : searchEngine
  Series -up-|> Media
  SeriesGenerator -up-|> ObjectGenerator
  SeriesGeneratorTest o-- FileReader : fr
  SeriesGeneratorTest o-- SeriesGenerator : sg

right footer

PlantUML diagram generated by SketchIt! (https://bitbucket.org/pmesmeur/sketch.it)
For more information about this tool, please contact philippe.mesmeur@gmail.com
endfooter
@enduml

生产:

注意,您的图表不容易阅读,因为它包含许多类,其中一些是孤立的。
页脚表明这是由sketchit生成的,我不知道,也许工具需要在一个名称空间中定义所有类,而不是在一个名称空间之外?

相关问题