mirror of
https://github.com/octoleo/plantuml.git
synced 2025-01-08 17:24:15 +00:00
Fix stereotype handling
This commit is contained in:
parent
4d01e6fd6c
commit
153b96af3e
@ -84,7 +84,7 @@ public class CommandCreateAttribute extends SingleLineCommand2<ChenEerDiagram> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final LeafType type = LeafType.USECASE;
|
final LeafType type = LeafType.USECASE;
|
||||||
final String name = diagram.cleanId(arg.get("NAME", 0));
|
final String name = diagram.cleanId(arg.get("NAME", 0).trim());
|
||||||
final String id = owner.getName() + "/" + name;
|
final String id = owner.getName() + "/" + name;
|
||||||
final boolean composite = arg.get("COMPOSITE", 0) != null;
|
final boolean composite = arg.get("COMPOSITE", 0) != null;
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ import net.sourceforge.plantuml.plasma.Quark;
|
|||||||
import net.sourceforge.plantuml.regex.IRegex;
|
import net.sourceforge.plantuml.regex.IRegex;
|
||||||
import net.sourceforge.plantuml.regex.RegexConcat;
|
import net.sourceforge.plantuml.regex.RegexConcat;
|
||||||
import net.sourceforge.plantuml.regex.RegexLeaf;
|
import net.sourceforge.plantuml.regex.RegexLeaf;
|
||||||
|
import net.sourceforge.plantuml.regex.RegexOptional;
|
||||||
import net.sourceforge.plantuml.regex.RegexResult;
|
import net.sourceforge.plantuml.regex.RegexResult;
|
||||||
import net.sourceforge.plantuml.utils.LineLocation;
|
import net.sourceforge.plantuml.utils.LineLocation;
|
||||||
|
|
||||||
@ -59,7 +60,11 @@ public class CommandCreateEntity extends SingleLineCommand2<ChenEerDiagram> {
|
|||||||
return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), //
|
return RegexConcat.build(CommandCreateEntity.class.getName(), RegexLeaf.start(), //
|
||||||
new RegexLeaf("TYPE", "(entity|relationship)"), //
|
new RegexLeaf("TYPE", "(entity|relationship)"), //
|
||||||
RegexLeaf.spaceOneOrMore(), //
|
RegexLeaf.spaceOneOrMore(), //
|
||||||
new RegexLeaf("NAME", "(\\w+)"), //
|
new RegexLeaf("NAME", "([^<>{}]+)"), //
|
||||||
|
new RegexOptional(//
|
||||||
|
new RegexConcat(
|
||||||
|
RegexLeaf.spaceZeroOrMore(), //
|
||||||
|
new RegexLeaf("STEREOTYPE", "(<<.+>>)"))), //
|
||||||
RegexLeaf.spaceZeroOrMore(), //
|
RegexLeaf.spaceZeroOrMore(), //
|
||||||
new RegexLeaf("\\{"), //
|
new RegexLeaf("\\{"), //
|
||||||
RegexLeaf.end());
|
RegexLeaf.end());
|
||||||
@ -69,7 +74,7 @@ public class CommandCreateEntity extends SingleLineCommand2<ChenEerDiagram> {
|
|||||||
protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation location, RegexResult arg)
|
protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation location, RegexResult arg)
|
||||||
throws NoSuchColorException {
|
throws NoSuchColorException {
|
||||||
final LeafType type = LeafType.OBJECT;
|
final LeafType type = LeafType.OBJECT;
|
||||||
final String name = diagram.cleanId(arg.get("NAME", 0));
|
final String name = diagram.cleanId(arg.get("NAME", 0).trim());
|
||||||
|
|
||||||
final Quark<Entity> quark = diagram.quarkInContext(true, name);
|
final Quark<Entity> quark = diagram.quarkInContext(true, name);
|
||||||
Entity entity = quark.getData();
|
Entity entity = quark.getData();
|
||||||
|
Loading…
Reference in New Issue
Block a user