diff --git a/src/net/sourceforge/plantuml/ErrorUml.java b/src/net/sourceforge/plantuml/ErrorUml.java index 8b607dec503..5576d6b5f21 100644 --- a/src/net/sourceforge/plantuml/ErrorUml.java +++ b/src/net/sourceforge/plantuml/ErrorUml.java @@ -37,21 +37,24 @@ import java.util.Objects; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.utils.LineLocation; public class ErrorUml { // ::remove file when __HAXE__ private final String error; - private final ErrorUmlType type; + private final ErrorUmlType errorType; private final LineLocation lineLocation; private final int score; + private final UmlDiagramType diagramType; - public ErrorUml(ErrorUmlType type, String error, int score, LineLocation lineLocation) { + public ErrorUml(ErrorUmlType type, String error, int score, LineLocation lineLocation, UmlDiagramType diagramType) { this.score = score; this.error = Objects.requireNonNull(error); - this.type = Objects.requireNonNull(type); + this.errorType = Objects.requireNonNull(type); this.lineLocation = lineLocation; + this.diagramType = diagramType; } public int score() { @@ -61,27 +64,26 @@ public int score() { @Override public boolean equals(Object obj) { final ErrorUml this2 = (ErrorUml) obj; - return this.type == this2.type && this.getPosition() == this2.getPosition() && this.error.equals(this2.error); + return this.errorType == this2.errorType && this.getPosition() == this2.getPosition() + && this.error.equals(this2.error); } @Override public int hashCode() { - return error.hashCode() + type.hashCode() + getPosition(); + return error.hashCode() + errorType.hashCode() + getPosition(); } @Override public String toString() { - return type.toString() + " " + getPosition() + " " + error; + return errorType.toString() + " " + getPosition() + " " + error; } public final String getError() { + if (diagramType != null) + return error + " (Assumed diagram type: " + diagramType.name().toLowerCase() + ")"; return error; } - public final ErrorUmlType getType() { - return type; - } - public final int getPosition() { return lineLocation.getPosition(); } diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index 4d669f4052e..9a783dc8e8b 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -142,7 +142,7 @@ final public Diagram createPSystem(List source, ListemptyList(), source); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java index 9be73d846e1..6c10f026574 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java +++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagramFactory.java @@ -55,6 +55,7 @@ import net.sourceforge.plantuml.command.note.CommandFactoryNoteActivity; import net.sourceforge.plantuml.command.note.CommandFactoryNoteOnLink; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class ActivityDiagramFactory extends PSystemCommandFactory { // ::remove folder when __HAXE__ @@ -92,4 +93,9 @@ protected void initCommandsList(List cmds) { } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.ACTIVITY; + } + } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java index 0b26c9fe371..df50e464429 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagramFactory3.java @@ -89,6 +89,7 @@ import net.sourceforge.plantuml.command.CommonCommands; import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class ActivityDiagramFactory3 extends PSystemCommandFactory { @@ -162,4 +163,9 @@ public ActivityDiagram3 createEmptyDiagram(UmlSource source, Map return new ActivityDiagram3(source, skinMap); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.ACTIVITY; + } + } diff --git a/src/net/sourceforge/plantuml/api/PSystemFactory.java b/src/net/sourceforge/plantuml/api/PSystemFactory.java index 6ea45b96215..1a27cfefa27 100644 --- a/src/net/sourceforge/plantuml/api/PSystemFactory.java +++ b/src/net/sourceforge/plantuml/api/PSystemFactory.java @@ -40,11 +40,14 @@ import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public interface PSystemFactory { Diagram createSystem(UmlSource source, Map skinMap); DiagramType getDiagramType(); + + UmlDiagramType getUmlDiagramType(); } diff --git a/src/net/sourceforge/plantuml/board/BoardDiagramFactory.java b/src/net/sourceforge/plantuml/board/BoardDiagramFactory.java index cfe1bc856a3..285851cb9dc 100644 --- a/src/net/sourceforge/plantuml/board/BoardDiagramFactory.java +++ b/src/net/sourceforge/plantuml/board/BoardDiagramFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class BoardDiagramFactory extends PSystemCommandFactory { // ::remove folder when __CORE__ @@ -68,4 +69,9 @@ public BoardDiagram createEmptyDiagram(UmlSource source, Map ski return new BoardDiagram(source); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.BOARD; + } + } diff --git a/src/net/sourceforge/plantuml/bpm/BpmDiagramFactory.java b/src/net/sourceforge/plantuml/bpm/BpmDiagramFactory.java index 7d7def904cc..d8fe03a11a9 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmDiagramFactory.java +++ b/src/net/sourceforge/plantuml/bpm/BpmDiagramFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class BpmDiagramFactory extends PSystemCommandFactory { @@ -65,5 +66,11 @@ protected void initCommandsList(List result) { public AbstractPSystem createEmptyDiagram(UmlSource source, Map skinMap) { return new BpmDiagram(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.BPM; + } + } diff --git a/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java index 5e9b9ebd2cd..a1c16b4089c 100644 --- a/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java +++ b/src/net/sourceforge/plantuml/cheneer/ChenEerDiagramFactory.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class ChenEerDiagramFactory extends PSystemCommandFactory { @@ -76,4 +77,9 @@ public AbstractPSystem createEmptyDiagram(UmlSource source, Map return new ChenEerDiagram(source, skinMap); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.CHEN_EER; + } + } diff --git a/src/net/sourceforge/plantuml/chronology/ChronologyDiagramFactory.java b/src/net/sourceforge/plantuml/chronology/ChronologyDiagramFactory.java index efdb854b59d..ec750b686c8 100644 --- a/src/net/sourceforge/plantuml/chronology/ChronologyDiagramFactory.java +++ b/src/net/sourceforge/plantuml/chronology/ChronologyDiagramFactory.java @@ -49,6 +49,7 @@ import net.sourceforge.plantuml.project.lang.SentenceAndAnd; import net.sourceforge.plantuml.project.lang.SentenceSimple; import net.sourceforge.plantuml.project.lang.Subject; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class ChronologyDiagramFactory extends PSystemCommandFactory { @@ -123,4 +124,9 @@ public ChronologyDiagram createEmptyDiagram(UmlSource source, Map cmds) { CommonCommands.addTitleCommands(cmds); CommonCommands.addCommonCommands2(cmds); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.CLASS; + } + } diff --git a/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java b/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java index 3e8f75af302..fcd3ff7b1a0 100644 --- a/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java +++ b/src/net/sourceforge/plantuml/command/PSystemAbstractFactory.java @@ -58,14 +58,14 @@ protected PSystemAbstractFactory(DiagramType type) { final protected PSystemError buildEmptyError(UmlSource source, LineLocation lineLocation, List trace) { - final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, EMPTY_DESCRIPTION, 0, lineLocation); + final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, EMPTY_DESCRIPTION, 0, lineLocation, getUmlDiagramType()); final PSystemError result = PSystemErrorUtils.buildV2(source, err, null, trace); return result; } final protected PSystemError buildExecutionError(UmlSource source, String stringError, LineLocation lineLocation, List trace) { - final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, stringError, 0, lineLocation); + final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, stringError, 0, lineLocation, getUmlDiagramType()); final PSystemError result = PSystemErrorUtils.buildV2(source, err, null, trace); return result; } diff --git a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java index fb992cda532..5461e12d527 100644 --- a/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java +++ b/src/net/sourceforge/plantuml/command/PSystemBasicFactory.java @@ -87,7 +87,7 @@ final public Diagram createSystem(UmlSource source, Map skinMap) } system = executeLine(source, system, s.getString()); if (system == null) { - final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, s.getLocation()); + final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, s.getLocation(), getUmlDiagramType()); // return PSystemErrorUtils.buildV1(source, err, null); return PSystemErrorUtils.buildV2(source, err, null, it.getTrace()); } diff --git a/src/net/sourceforge/plantuml/command/PSystemCommandFactory.java b/src/net/sourceforge/plantuml/command/PSystemCommandFactory.java index d7a43fcf3dc..6957262bf5f 100644 --- a/src/net/sourceforge/plantuml/command/PSystemCommandFactory.java +++ b/src/net/sourceforge/plantuml/command/PSystemCommandFactory.java @@ -130,7 +130,7 @@ private AbstractPSystem executeFewLines(AbstractPSystem sys, UmlSource source, f ParserPass currentPass) { final Step step = getCandidate(it); if (step == null) { - final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, it.peek().getLocation()); + final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, it.peek().getLocation(), getUmlDiagramType()); it.next(); return PSystemErrorUtils.buildV2(source, err, null, it.getTrace()); } @@ -142,7 +142,7 @@ private AbstractPSystem executeFewLines(AbstractPSystem sys, UmlSource source, f if (result.isOk() == false) { final LineLocation location = ((StringLocated) step.blocLines.getFirst()).getLocation(); final ErrorUml err = new ErrorUml(ErrorUmlType.EXECUTION_ERROR, result.getError(), result.getScore(), - location); + location, getUmlDiagramType()); sys = PSystemErrorUtils.buildV2(source, err, result.getDebugLines(), it.getTrace()); } if (result.getNewDiagram() != null) diff --git a/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java b/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java index 635e1bf59e4..705dca888a3 100644 --- a/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java +++ b/src/net/sourceforge/plantuml/command/PSystemSingleLineFactory.java @@ -44,6 +44,7 @@ import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.error.PSystemErrorUtils; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.text.StringLocated; import net.sourceforge.plantuml.utils.LineLocation; import net.sourceforge.plantuml.utils.StartUtils; @@ -82,12 +83,18 @@ final public Diagram createSystem(UmlSource source, Map skinMap) final AbstractPSystem sys = executeLine(source, s.getString()); if (sys == null) { - final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, s.getLocation()); + final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", 0, s.getLocation(), getUmlDiagramType()); // return PSystemErrorUtils.buildV1(source, err, null); return PSystemErrorUtils.buildV2(source, err, null, it.getTrace()); } return sys; } + + @Override + final public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java index 9b8df0b354f..8b3bcd87f9b 100644 --- a/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java +++ b/src/net/sourceforge/plantuml/compositediagram/CompositeDiagramFactory.java @@ -46,6 +46,7 @@ import net.sourceforge.plantuml.compositediagram.command.CommandEndPackageBlock; import net.sourceforge.plantuml.compositediagram.command.CommandLinkBlock; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.style.ISkinSimple; public class CompositeDiagramFactory extends PSystemCommandFactory { @@ -69,4 +70,10 @@ protected void initCommandsList(List cmds) { public CompositeDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new CompositeDiagram(source, skinMap); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.COMPOSITE; + } + } diff --git a/src/net/sourceforge/plantuml/definition/PSystemDefinitionFactory.java b/src/net/sourceforge/plantuml/definition/PSystemDefinitionFactory.java index 5273902cd0c..9e0cb7b7681 100644 --- a/src/net/sourceforge/plantuml/definition/PSystemDefinitionFactory.java +++ b/src/net/sourceforge/plantuml/definition/PSystemDefinitionFactory.java @@ -38,6 +38,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemDefinitionFactory extends PSystemBasicFactory { @@ -58,5 +59,11 @@ public PSystemDefinition executeLine(UmlSource source, PSystemDefinition system, system.doCommandLine(line); return system; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java index 6bb95f33860..0011164dbef 100644 --- a/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java +++ b/src/net/sourceforge/plantuml/descdiagram/DescriptionDiagramFactory.java @@ -65,6 +65,7 @@ import net.sourceforge.plantuml.objectdiagram.command.CommandCreateMap; import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexOr; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class DescriptionDiagramFactory extends PSystemCommandFactory { @@ -126,5 +127,11 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandArchimateMultilines()); cmds.add(new CommandCreateDomain()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.DESCRIPTION; + } + } diff --git a/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java b/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java index 6af8b8849ee..c74f5b4c569 100644 --- a/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java +++ b/src/net/sourceforge/plantuml/directdot/PSystemDotFactory.java @@ -37,6 +37,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemDotFactory extends PSystemBasicFactory { @@ -66,4 +67,10 @@ public PSystemDot executeLine(UmlSource source, PSystemDot system, String line) data.append("\n"); return new PSystemDot(source, data.toString()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/ditaa/PSystemDitaaFactory.java b/src/net/sourceforge/plantuml/ditaa/PSystemDitaaFactory.java index 42719cc835b..21042170546 100644 --- a/src/net/sourceforge/plantuml/ditaa/PSystemDitaaFactory.java +++ b/src/net/sourceforge/plantuml/ditaa/PSystemDitaaFactory.java @@ -41,6 +41,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemDitaaFactory extends PSystemBasicFactory { // ::remove folder when __HAXE__ @@ -170,4 +171,11 @@ private Font extractFont(String line) { return new Font(fontName, fontVariant, fontSize); } + + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/ebnf/PSystemEbnfFactory.java b/src/net/sourceforge/plantuml/ebnf/PSystemEbnfFactory.java index 29f35ce8b4a..287f31a9628 100644 --- a/src/net/sourceforge/plantuml/ebnf/PSystemEbnfFactory.java +++ b/src/net/sourceforge/plantuml/ebnf/PSystemEbnfFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemEbnfFactory extends PSystemCommandFactory { @@ -65,5 +66,11 @@ protected void initCommandsList(List cmds) { public PSystemEbnf createEmptyDiagram(UmlSource source, Map skinMap) { return new PSystemEbnf(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.EBNF; + } + } diff --git a/src/net/sourceforge/plantuml/eggs/PSystemWelcomeFactory.java b/src/net/sourceforge/plantuml/eggs/PSystemWelcomeFactory.java index 539fc0791ee..2e695d39405 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemWelcomeFactory.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemWelcomeFactory.java @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.klimt.geom.GraphicPosition; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemWelcomeFactory implements PSystemFactory { @@ -56,5 +57,11 @@ public Diagram createSystem(UmlSource source, Map skinMap) { public DiagramType getDiagramType() { return DiagramType.UML; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/error/PSystemErrorPreprocessor.java b/src/net/sourceforge/plantuml/error/PSystemErrorPreprocessor.java index e742407baba..0c485f154b0 100644 --- a/src/net/sourceforge/plantuml/error/PSystemErrorPreprocessor.java +++ b/src/net/sourceforge/plantuml/error/PSystemErrorPreprocessor.java @@ -49,7 +49,7 @@ public PSystemErrorPreprocessor(List input, List t DiagramType.getTypeFromArobaseStart(input.get(0).getString()) == DiagramType.UML)); this.trace = trace; this.singleError = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, getLastLine().getPreprocessorError(), 0, - getLastLine().getLocation()); + getLastLine().getLocation(), null); } diff --git a/src/net/sourceforge/plantuml/filesdiagram/FilesDiagramFactory.java b/src/net/sourceforge/plantuml/filesdiagram/FilesDiagramFactory.java index 885c88d98a7..d6fbc6a5264 100644 --- a/src/net/sourceforge/plantuml/filesdiagram/FilesDiagramFactory.java +++ b/src/net/sourceforge/plantuml/filesdiagram/FilesDiagramFactory.java @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.jsondiagram.StyleExtractor; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class FilesDiagramFactory extends PSystemAbstractFactory { @@ -56,4 +57,9 @@ public Diagram createSystem(UmlSource source, Map skinMap) { return new FilesDiagram(source, styleExtractor); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.FILES; + } + } diff --git a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java index 3546a0f6bae..806fe8f99fe 100644 --- a/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java +++ b/src/net/sourceforge/plantuml/flowdiagram/FlowDiagramFactory.java @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class FlowDiagramFactory extends PSystemCommandFactory { @@ -59,5 +60,11 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandLineSimple()); cmds.add(new CommandLink()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.FLOW; + } + } diff --git a/src/net/sourceforge/plantuml/gitlog/GitDiagramFactory.java b/src/net/sourceforge/plantuml/gitlog/GitDiagramFactory.java index 270caef56a6..c400cfd5292 100644 --- a/src/net/sourceforge/plantuml/gitlog/GitDiagramFactory.java +++ b/src/net/sourceforge/plantuml/gitlog/GitDiagramFactory.java @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.core.Diagram; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.text.StringLocated; public class GitDiagramFactory extends PSystemAbstractFactory { @@ -66,4 +67,9 @@ public Diagram createSystem(UmlSource source, Map skinMap) { return new GitDiagram(source, textArea); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.GIT; + } + } diff --git a/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java b/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java index 34f652b46fe..477a8eeb8dd 100644 --- a/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java +++ b/src/net/sourceforge/plantuml/hcl/HclDiagramFactory.java @@ -89,5 +89,11 @@ public Diagram createSystem(UmlSource source, Map skinMap) { // } return result; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.HCL; + } + } diff --git a/src/net/sourceforge/plantuml/help/HelpFactory.java b/src/net/sourceforge/plantuml/help/HelpFactory.java index dea8a474a91..3697aa9e617 100644 --- a/src/net/sourceforge/plantuml/help/HelpFactory.java +++ b/src/net/sourceforge/plantuml/help/HelpFactory.java @@ -41,6 +41,7 @@ import net.sourceforge.plantuml.command.Command; import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class HelpFactory extends PSystemCommandFactory { // ::comment when __CORE__ @@ -60,4 +61,9 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandHelpTheme()); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.HELP; + } + } diff --git a/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java b/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java index 63424dc1d57..c07d04b3ca8 100644 --- a/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java +++ b/src/net/sourceforge/plantuml/jcckit/PSystemJcckitFactory.java @@ -47,6 +47,7 @@ import net.sourceforge.plantuml.regex.Matcher2; import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.Pattern2; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.text.BackSlash; import net.sourceforge.plantuml.utils.Log; @@ -117,4 +118,9 @@ public PSystemJcckit executeLine(UmlSource source, PSystemJcckit system, String return createSystem(source); } + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java index 119adc6004b..68434a22fa2 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java +++ b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java @@ -106,5 +106,11 @@ public Diagram createSystem(UmlSource source, Map skinMap) { } return result; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.JSON; + } + } diff --git a/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreoleFactory.java b/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreoleFactory.java index fc18ac206ca..8a1bffd3d7f 100644 --- a/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreoleFactory.java +++ b/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreoleFactory.java @@ -38,6 +38,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemCreoleFactory extends PSystemBasicFactory { // ::remove file when __CORE__ @@ -59,5 +60,11 @@ public PSystemCreole executeLine(UmlSource source, PSystemCreole system, String system.doCommandLine(line); return system; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/klimt/sprite/ListSpriteDiagramFactory.java b/src/net/sourceforge/plantuml/klimt/sprite/ListSpriteDiagramFactory.java index d39c26eb436..0174687c139 100644 --- a/src/net/sourceforge/plantuml/klimt/sprite/ListSpriteDiagramFactory.java +++ b/src/net/sourceforge/plantuml/klimt/sprite/ListSpriteDiagramFactory.java @@ -42,6 +42,7 @@ import net.sourceforge.plantuml.command.CommonCommands; import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class ListSpriteDiagramFactory extends PSystemCommandFactory { // ::remove file when __CORE__ @@ -58,4 +59,9 @@ public ListSpriteDiagram createEmptyDiagram(UmlSource source, Map cmds) { public StdlibDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new StdlibDiagram(source, skinMap); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/math/PSystemLatexFactory.java b/src/net/sourceforge/plantuml/math/PSystemLatexFactory.java index fed84fa7ccf..91cf03723a7 100644 --- a/src/net/sourceforge/plantuml/math/PSystemLatexFactory.java +++ b/src/net/sourceforge/plantuml/math/PSystemLatexFactory.java @@ -38,6 +38,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemLatexFactory extends PSystemBasicFactory { @@ -58,5 +59,11 @@ public PSystemLatex executeLine(UmlSource source, PSystemLatex system, String li system.doCommandLine(line); return system; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/math/PSystemMathFactory.java b/src/net/sourceforge/plantuml/math/PSystemMathFactory.java index 1c997fd154d..03647ee744d 100644 --- a/src/net/sourceforge/plantuml/math/PSystemMathFactory.java +++ b/src/net/sourceforge/plantuml/math/PSystemMathFactory.java @@ -38,6 +38,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemMathFactory extends PSystemBasicFactory { @@ -59,4 +60,9 @@ public PSystemMath executeLine(UmlSource source, PSystemMath system, String line return system; } + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/mindmap/MindMapDiagramFactory.java b/src/net/sourceforge/plantuml/mindmap/MindMapDiagramFactory.java index ed7c9e2a6f9..5dd0fc3243a 100644 --- a/src/net/sourceforge/plantuml/mindmap/MindMapDiagramFactory.java +++ b/src/net/sourceforge/plantuml/mindmap/MindMapDiagramFactory.java @@ -44,6 +44,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class MindMapDiagramFactory extends PSystemCommandFactory { @@ -67,5 +68,11 @@ protected void initCommandsList(List cmds) { public MindMapDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new MindMapDiagram(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.MINDMAP; + } + } diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagramFactory.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagramFactory.java index 820fabd9913..aa527555040 100644 --- a/src/net/sourceforge/plantuml/nwdiag/NwDiagramFactory.java +++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagramFactory.java @@ -44,6 +44,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class NwDiagramFactory extends PSystemCommandFactory { @@ -70,4 +71,9 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandFootboxIgnored()); } + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.NWDIAG; + } + } diff --git a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java b/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java index 5a00570056d..d8e052b6895 100644 --- a/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java +++ b/src/net/sourceforge/plantuml/oregon/PSystemOregonFactory.java @@ -37,6 +37,7 @@ import net.sourceforge.plantuml.command.PSystemBasicFactory; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemOregonFactory extends PSystemBasicFactory { @@ -56,5 +57,11 @@ public PSystemOregon executeLine(UmlSource source, PSystemOregon system, String system.add(line); return system; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return null; + } + } diff --git a/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java b/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java index 768d66fbd35..200a4a75513 100644 --- a/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java +++ b/src/net/sourceforge/plantuml/picoweb/PicoWebServer.java @@ -269,7 +269,7 @@ public void handleRenderRequest(RenderRequest renderRequest, BufferedOutputStrea if (ssr.getBlocks().size() == 0) { system = PSystemErrorUtils.buildV2(null, - new ErrorUml(SYNTAX_ERROR, "No valid @start/@end found, please check the version", 0, new LineLocationImpl("", null)), null, + new ErrorUml(SYNTAX_ERROR, "No valid @start/@end found, please check the version", 0, new LineLocationImpl("", null), null), null, Collections.emptyList()); imageData = ssr.noValidStartFound(os, option.getFileFormatOption()); } else { diff --git a/src/net/sourceforge/plantuml/project/GanttDiagramFactory.java b/src/net/sourceforge/plantuml/project/GanttDiagramFactory.java index 37fb00fcae2..cb6aa5d2a3b 100644 --- a/src/net/sourceforge/plantuml/project/GanttDiagramFactory.java +++ b/src/net/sourceforge/plantuml/project/GanttDiagramFactory.java @@ -74,6 +74,7 @@ import net.sourceforge.plantuml.project.lang.SubjectSeparator; import net.sourceforge.plantuml.project.lang.SubjectTask; import net.sourceforge.plantuml.project.lang.SubjectToday; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.style.CommandStyleImport; import net.sourceforge.plantuml.style.CommandStyleMultilinesCSS; @@ -149,5 +150,11 @@ private void addLanguageCommands(List cmd) { public GanttDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new GanttDiagram(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.GANTT; + } + } diff --git a/src/net/sourceforge/plantuml/regexdiagram/PSystemRegexFactory.java b/src/net/sourceforge/plantuml/regexdiagram/PSystemRegexFactory.java index 0fdaaa82712..36b844f3659 100644 --- a/src/net/sourceforge/plantuml/regexdiagram/PSystemRegexFactory.java +++ b/src/net/sourceforge/plantuml/regexdiagram/PSystemRegexFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemRegexFactory extends PSystemCommandFactory { @@ -60,5 +61,11 @@ protected void initCommandsList(List cmds) { public PSystemRegex createEmptyDiagram(UmlSource source, Map skinMap) { return new PSystemRegex(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.REGEX; + } + } diff --git a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java index 60fa740937a..d4979c338ed 100644 --- a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java +++ b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class PSystemSaltFactory extends PSystemCommandFactory { @@ -68,5 +69,11 @@ public PSystemSalt createEmptyDiagram(UmlSource source, Map skin } return result; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.SALT; + } + } diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java index ad4be77d290..d79b925769a 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java +++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagramFactory.java @@ -79,6 +79,7 @@ import net.sourceforge.plantuml.sequencediagram.command.CommandReferenceOverSeveral; import net.sourceforge.plantuml.sequencediagram.command.CommandReturn; import net.sourceforge.plantuml.sequencediagram.command.CommandUrl; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class SequenceDiagramFactory extends PSystemCommandFactory { @@ -146,5 +147,11 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandUrl()); cmds.add(new CommandLinkAnchor()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.SEQUENCE; + } + } diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java index 6c78456130e..cbe88c804d8 100644 --- a/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java +++ b/src/net/sourceforge/plantuml/statediagram/StateDiagramFactory.java @@ -57,6 +57,7 @@ import net.sourceforge.plantuml.objectdiagram.command.CommandCreateMap; import net.sourceforge.plantuml.regex.RegexLeaf; import net.sourceforge.plantuml.regex.RegexOr; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.statediagram.command.CommandAddField; import net.sourceforge.plantuml.statediagram.command.CommandConcurrentState; import net.sourceforge.plantuml.statediagram.command.CommandCreatePackage2; @@ -111,5 +112,11 @@ protected void initCommandsList(List cmds) { CommonCommands.addCommonCommands1(cmds); cmds.add(new CommandHideShow2()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.STATE; + } + } diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java index d8eadc37748..53e7ed5bf09 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagramFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.CommonCommands; import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; import net.sourceforge.plantuml.timingdiagram.command.CommandAnalog; import net.sourceforge.plantuml.timingdiagram.command.CommandAtPlayer; import net.sourceforge.plantuml.timingdiagram.command.CommandAtTime; @@ -98,5 +99,11 @@ protected void initCommandsList(List cmds) { cmds.add(new CommandPixelHeight()); cmds.add(new CommandUseDateFormat()); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.TIMING; + } + } diff --git a/src/net/sourceforge/plantuml/wbs/WBSDiagramFactory.java b/src/net/sourceforge/plantuml/wbs/WBSDiagramFactory.java index 3cf2df2f419..26211900a2d 100644 --- a/src/net/sourceforge/plantuml/wbs/WBSDiagramFactory.java +++ b/src/net/sourceforge/plantuml/wbs/WBSDiagramFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class WBSDiagramFactory extends PSystemCommandFactory { @@ -63,5 +64,11 @@ protected void initCommandsList(List cmds) { public WBSDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new WBSDiagram(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.WBS; + } + } diff --git a/src/net/sourceforge/plantuml/wire/WireDiagramFactory.java b/src/net/sourceforge/plantuml/wire/WireDiagramFactory.java index 253a115b88d..5186557b776 100644 --- a/src/net/sourceforge/plantuml/wire/WireDiagramFactory.java +++ b/src/net/sourceforge/plantuml/wire/WireDiagramFactory.java @@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; +import net.sourceforge.plantuml.skin.UmlDiagramType; public class WireDiagramFactory extends PSystemCommandFactory { @@ -66,5 +67,11 @@ protected void initCommandsList(List cmds) { public WireDiagram createEmptyDiagram(UmlSource source, Map skinMap) { return new WireDiagram(source); } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.WIRE; + } + } diff --git a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java index ce2e1d9ee0c..cbfccb1819a 100644 --- a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java +++ b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java @@ -100,5 +100,11 @@ public Diagram createSystem(UmlSource source, Map skinMap) { } return result; } + + @Override + public UmlDiagramType getUmlDiagramType() { + return UmlDiagramType.YAML; + } + }