Kaynağa Gözat

Added ImplementedBy annotation for default implementation and added comments.

tomqc86@googlemail.com 11 yıl önce
ebeveyn
işleme
2a7ec31870

+ 16 - 5
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/DefaultExecutionSlotResolver.xtend

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
 package org.yakindu.sct.simulation.core.sexec.interpreter
 
 import com.google.inject.Inject
@@ -17,6 +27,11 @@ import org.yakindu.sct.simulation.core.sruntime.ExecutionContext
 import org.yakindu.sct.simulation.core.sruntime.ExecutionSlot
 import org.yakindu.sct.simulation.core.sruntime.ExecutionVariable
 
+/**
+ * Default implementation for resolving execution slots based on expressions.
+ * 
+ * @author Thomas Kutz
+ */
 class DefaultExecutionSlotResolver implements IExecutionSlotResolver {
 
 	@Inject
@@ -87,7 +102,7 @@ class DefaultExecutionSlotResolver implements IExecutionSlotResolver {
 		}
 		context.getEvent(fqn)
 	}
-
+
 	def dispatch resolveEvent(ExecutionContext context, Expression expression) {}
 	def dispatch resolveVariable(ExecutionContext context, EObject expression) {}
 
@@ -95,11 +110,7 @@ class DefaultExecutionSlotResolver implements IExecutionSlotResolver {
 		varDef.getFullyQualifiedName
 	}
 
-
 	def private name(EObject e) {
 		return SimpleAttributeResolver::NAME_RESOLVER.apply(e)
 	}
-	
-	
-	
 }

+ 20 - 1
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/IExecutionSlotResolver.java

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) 2014 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
 package org.yakindu.sct.simulation.core.sexec.interpreter;
 
 import org.eclipse.emf.ecore.EObject;
@@ -6,9 +16,18 @@ import org.yakindu.sct.simulation.core.sruntime.ExecutionContext;
 import org.yakindu.sct.simulation.core.sruntime.ExecutionEvent;
 import org.yakindu.sct.simulation.core.sruntime.ExecutionSlot;
 
-public interface IExecutionSlotResolver {
+import com.google.inject.ImplementedBy;
 
+/**
+ * Resolves execution variables and events for given context and expression.
+ * 
+ * @author Thomas Kutz
+ *
+ */
+@ImplementedBy(DefaultExecutionSlotResolver.class)
+public interface IExecutionSlotResolver {
 	
+	// TODO use Expression instead of EObject
 	ExecutionSlot resolveVariable(ExecutionContext context, EObject expression);
 	
 	ExecutionEvent resolveEvent(ExecutionContext context, Expression expression);