Groovy API Client Code

Since calling Java from Groovy is pretty simple, the only thing to do is to copy PlantUML.jar file to the classpath (for example, ../Groovy/Groovy-1.7.6/lib directory).

The following script print the current PlantUML version, and encode a URL:

println net.sourceforge.plantuml.version.Version.version() println

If you want to generate an image from a description:

s = new net.sourceforge.plantuml.SourceStringReader("@startuml\nBob->Alice:hello\n@enduml")
FileOutputStream file = new FileOutputStream("c:/testGroovy2.png")

Privacy Policy      Advertise