Wednesday, 21 June 2023

PlantUML: Define note in several lines

 

You can define multiline notes in two ways.

a.   Using end note keyword

b.   Using \n

 

Example 1

note top of List 
An ordered collection (also known as a sequence). 
The user of this interface has precise control 
over where in the list each element is inserted.
end note

Example 2

note right of ArrayList : Resizable-array implementation \n of the List interface

 

multiLineNotes.txt

@startuml

interface List{
	
}

abstract class AbstractList implements List{
	
}

interface Serializable{
	
}

class ArrayList extends AbstractList implements Serializable{
	
}

note top of List 
An ordered collection (also known as a sequence). 
The user of this interface has precise control 
over where in the list each element is inserted.
end note

note left of AbstractList
This class provides a skeletal implementation of the List interface 
to minimize the effort required to implement this interface backed by 
a "random access" data store (such as an array).
end note


note right of ArrayList : Resizable-array implementation \n of the List interface
note bottom of Serializable : Serializability of a class is enabled \n by the class implementing this

@enduml

Above snippet generate below diagram.



  

Previous                                                    Next                                                    Home

No comments:

Post a Comment