forked from SysMLinJavaModeler/SysMLinJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSysMLComment.java
More file actions
49 lines (45 loc) · 1.62 KB
/
Copy pathSysMLComment.java
File metadata and controls
49 lines (45 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package sysmlinjava.comments;
import sysmlinjava.common.SysMLClass;
/**
* SysMLinJava's representation of the SysML comment.
* <h2>Basic comment</h2>The {@code SysMLComment} is a simple (extendable) class
* for a textual comment. The {@code SysMLComment} is typically declared in a
* {@code @Comment} annotated field in the SysML element, such as a block,
* interfaceBlock, valueType, etc. to which the comment applies. It is
* instantiated/initialized with the comment text in the
* {@code createComments()} method of the element.
* <h3>Comment "libraries"</h3> Comments can also be declared as static
* variables in block elements that serve as a container of comments. These
* comments can then serve as a set of reusable comments that can be referenced
* by multiple elements that need the same comment.
* <h3>Comment extensions - problems, hyperlinks, etc.</h3> Consistent with
* SysML, the {@code SysMLComment} is extended for specialized types of comments
* by other SysMLinJava classes such as the {@code SysMLHyperlink},
* {@code SysMLProblem}, and {@code SysMLRationale}.
*
* @author ModelerOne
*
*/
public class SysMLComment extends SysMLClass
{
/**
* Text of the comment. Extensions to the {@code SysMLComment} may use formatted
* strings here to represent their structured comment.
*/
public String text;
/**
* Constructor for the comment text
*
* @param text Text of the comment
*/
public SysMLComment(String text)
{
super();
this.text = text;
}
@Override
public String toString()
{
return String.format("SysMLComment [text=%s]", text);
}
}