diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CodeEntity.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CodeEntity.java index cb1297cc..4721704b 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CodeEntity.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CodeEntity.java @@ -51,6 +51,8 @@ package eu.mihosoft.vrl.lang.model; import eu.mihosoft.vrl.workflow.VNode; +import java.util.Map; +import javafx.collections.ObservableMap; /** * @@ -60,6 +62,8 @@ public interface CodeEntity extends ObservableCode, EventSender{ public void setId(String id); public String getId(); + public ObservableMap getMetaData(); + // public void setCode(String code); // public String getCode(); diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CommentImpl.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CommentImpl.java index ee417c76..97adef46 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CommentImpl.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/CommentImpl.java @@ -54,6 +54,8 @@ import eu.mihosoft.vrl.lang.model.ICodeRange; import eu.mihosoft.vrl.lang.model.Scope; import eu.mihosoft.vrl.workflow.VNode; +import javafx.collections.FXCollections; +import javafx.collections.ObservableMap; /** * @@ -69,6 +71,7 @@ public class CommentImpl implements Comment { private VNode node; private ObservableCodeImpl observableCode; private boolean textRenderingEnabled = true; + private final ObservableMap metadata = FXCollections.observableHashMap(); public CommentImpl(String id, ICodeRange codeRange, String comment) { this.id = id; @@ -208,4 +211,12 @@ public boolean isTextRenderingEnabled() { return textRenderingEnabled; } + /** + * @return the metadata + */ + @Override + public ObservableMap getMetaData() { + return metadata; + } + } diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/IfDeclarationImpl.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/IfDeclarationImpl.java index 5fb54258..037b1326 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/IfDeclarationImpl.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/IfDeclarationImpl.java @@ -27,10 +27,10 @@ public IfDeclarationImpl(String id, Scope parent, IArgument arg) { @Override public IArgument getCheck() { - return getMetaData().getCheck(); + return getIfMetaData().getCheck(); } - private IfDeclarationMetaData getMetaData() { + private IfDeclarationMetaData getIfMetaData() { if (metadata == null) { metadata = (IfDeclarationMetaData) getScopeArgs()[0]; } @@ -45,9 +45,9 @@ public void defineParameters(Invocation i) { i.getArguments().addListener((ListChangeListener.Change c) -> { while (c.next()) { if (i.getArguments().isEmpty()) { - getMetaData().setCheck(Argument.NULL); + getIfMetaData().setCheck(Argument.NULL); } else { - getMetaData().setCheck(i.getArguments().get(0)); + getIfMetaData().setCheck(i.getArguments().get(0)); } } }); diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/InvocationImpl.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/InvocationImpl.java index 0c144f90..ca4d837a 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/InvocationImpl.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/InvocationImpl.java @@ -55,11 +55,11 @@ import eu.mihosoft.vrl.workflow.WorkflowUtil; import java.util.ArrayList; import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Objects; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import javafx.collections.ObservableMap; /** * @@ -82,6 +82,8 @@ class InvocationImpl implements Invocation { private VNode node; private ObservableCodeImpl observableCode; private boolean textRenderingEnabled = true; + + private final ObservableMap metadata = FXCollections.observableHashMap(); public InvocationImpl( Scope parent, @@ -433,4 +435,12 @@ void setParent(Scope parent) { } } + /** + * @return the metadata + */ + @Override + public ObservableMap getMetaData() { + return metadata; + } + } diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/ScopeImpl.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/ScopeImpl.java index 2f4e0a3c..25a9febc 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/ScopeImpl.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/ScopeImpl.java @@ -64,6 +64,7 @@ import javafx.collections.FXCollections; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; +import javafx.collections.ObservableMap; /** * @@ -88,6 +89,8 @@ class ScopeImpl implements Scope { private VFlow flow; private ObservableCodeImpl observableCode; private boolean textRenderingEnabled = true; + + private final ObservableMap metadata = FXCollections.observableHashMap(); public ScopeImpl(String id, Scope parent, ScopeType type, String name, VFlow flowParent, Object... scopeArgs) { this.id = id; @@ -585,4 +588,12 @@ public boolean isTextRenderingEnabled() { return textRenderingEnabled; } + /** + * @return the metadata + */ + @Override + public ObservableMap getMetaData() { + return metadata; + } + } diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/WhileDeclaration_Impl.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/WhileDeclaration_Impl.java index d824ebe1..164e2cd6 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/WhileDeclaration_Impl.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/WhileDeclaration_Impl.java @@ -67,10 +67,10 @@ public WhileDeclaration_Impl(String id, Scope parent, IArgument argument) { @Override public IArgument getCheck() { - return getMetaData().getCheck(); + return getWhileMetaData().getCheck(); } - private WhileDeclarationMetaData getMetaData() { + private WhileDeclarationMetaData getWhileMetaData() { if (metadata == null) { metadata = (WhileDeclarationMetaData) getScopeArgs()[0]; } @@ -85,9 +85,9 @@ public void defineParameters(Invocation i) { i.getArguments().addListener((ListChangeListener.Change c) -> { while (c.next()) { if (i.getArguments().isEmpty()) { - getMetaData().setCheck(Argument.NULL); + getWhileMetaData().setCheck(Argument.NULL); } else { - getMetaData().setCheck(i.getArguments().get(0)); + getWhileMetaData().setCheck(i.getArguments().get(0)); } } }); diff --git a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/CodeTransform.java b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/CodeTransform.java index 9c2f3971..34fb8aa3 100644 --- a/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/CodeTransform.java +++ b/VRL/VRL-Lang/src/main/java/eu/mihosoft/vrl/lang/model/transform/CodeTransform.java @@ -16,8 +16,8 @@ public interface CodeTransform { /** * - * @param ce - * @return + * @param ce conde entity to transform + * @return transformed copy of the cpecified code entity */ public T transform(T ce); }