Bladeren bron

#366 : javadoc, comments & AbstractSGraphModelGenerator.generate should
not be final

Johannes Dicks 9 jaren geleden
bovenliggende
commit
7ee8c23f5b

+ 4 - 9
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/filesystem/ISCTFileSystemAccess.java

@@ -24,9 +24,8 @@ import org.eclipse.xtext.generator.OutputConfiguration;
  * The SCT M2T generators use the minimal functionality provided by the
  * basic interface xtext.generator.IFileSystemAccess during transformation.
  * 
- * So the methods 
- * 
  * @see {@link org.eclipse.xtext.generator.IFileSystemAccess}
+ * 
  * @author Johannes Dicks - Initial contribution and API
  *
  */
@@ -41,27 +40,23 @@ public interface ISCTFileSystemAccess {
 	URI getURI(String path);
 
 	/**
+	 * Add an output path for an output name.
+	 * 
 	 * @param outletFeatureTargetProject
 	 * @param stringValue
 	 */
 	void setOutputPath(String outputName, String path);
 
-	/**
-	 * @return
-	 */
 	Map<String, OutputConfiguration> getOutputConfigurations();
-
 	/**
 	 * For convenience... and compatibility reasons, might be removed in further
 	 * versions
-	 * 
 	 * @return
-	 * 
 	 */
 	IFileSystemAccess getIFileSystemAccess();
 
 	/**
-	 * @param entry
+	 * A hook to execute actions after generation.
 	 */
 	void afterGeneration();
 

+ 5 - 4
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/AbstractSGraphModelGenerator.java

@@ -67,11 +67,12 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
 	 * initializations which are urgently needed for the generator
 	 * infrastructure. Use {@link #doGenerate(GeneratorEntry)} instead.
 	 * 
+	 * This method might become final in further versions. Please
+	 *             override {@link #doGenerate(GeneratorEntry)}
+	 * 
 	 * @see {@link #doGenerate(GeneratorEntry)}
-	 * @deprecated this method might become final in further versions. Please
-	 *             override {@link #doGenerate(GeneratorEntry)}.
 	 */
-	public final void generate(GeneratorEntry entry) {
+	public void generate(GeneratorEntry entry) {
 		if (canHandle(entry)) {
 			try {
 				logStart(entry);
@@ -157,8 +158,8 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
 		return new Module() {
 			@Override
 			public void configure(Binder binder) {
+				// currently, do not add additional bindings
 			}
-			// per default, do not add additional bindings
 		};
 	}
 

+ 3 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/library/OutletFeatureHelperImpl.java

@@ -17,6 +17,9 @@ import org.yakindu.sct.generator.core.features.ICoreFeatureConstants;
 import org.yakindu.sct.model.sgen.FeatureParameterValue;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
 
+/**
+ * @author Johannes Dicks - Initial contribution and API
+ */
 public class OutletFeatureHelperImpl extends BaseSGenFeatureHelper implements IOutletFeatureHelper {
 
 	@Override

+ 2 - 31
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/util/EFSHelper.java

@@ -94,9 +94,6 @@ public class EFSHelper {
 		return project.getFolder(new Path(path));
 	}
 
-	/**
-	 * @param container
-	 */
 	public void createContainer(IContainer container) {
 		try {
 			ensureExists(container);
@@ -106,12 +103,6 @@ public class EFSHelper {
 		
 	}
 
-	/**
-	 * @param fileName
-	 * @param iProject 
-	 * @param outputName
-	 * @return
-	 */
 	public IFile getFile(String fileName, OutputConfiguration config, IProject iProject) {
 		IContainer container = getContainer(config,iProject);
 		if (container != null) {
@@ -122,10 +113,6 @@ public class EFSHelper {
 		return null;
 	}
 
-	/**
-	 * @param result
-	 * @param nullProgressMonitor
-	 */
 	private void refreshFileSilently(IFile result, NullProgressMonitor nullProgressMonitor) {
 		try {
 			result.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
@@ -134,11 +121,7 @@ public class EFSHelper {
 		}
 	}
 
-	/**
-	 * @param file
-	 * @param newContent
-	 * @return
-	 */
+
 	public boolean hasContentsChanged(IFile file, StringInputStream newContent) {
 		boolean contentChanged = false;
 		BufferedInputStream oldContent = null;
@@ -167,18 +150,11 @@ public class EFSHelper {
 		return contentChanged;
 	}
 	
-	/**
-	 * @param file
-	 * @param isDerived
-	 */
+
 	public void setDerived(IFile file, boolean isDerived) throws CoreException {
 		file.setDerived(isDerived, new NullProgressMonitor());
 	}
 
-	/**
-	 * @param file
-	 * @throws CoreException 
-	 */
 	public void ensureParentExists(IFile file) throws CoreException {
 		if (!file.exists()) {
 			ensureExists(file.getParent());
@@ -186,11 +162,6 @@ public class EFSHelper {
 		
 	}
 
-	/**
-	 * @param contentsAsString
-	 * @param encoding
-	 * @return
-	 */
 	public StringInputStream getInputStream(String contentsAsString, String encoding) {
 		try {
 			return new StringInputStream(contentsAsString, encoding);

+ 14 - 2
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/util/EclipseConsoleLog.java

@@ -1,3 +1,14 @@
+/**
+ * Copyright (c) 2016 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.generator.core.util;
 
 import java.io.PrintWriter;
@@ -11,6 +22,9 @@ import org.eclipse.ui.console.MessageConsole;
 import org.eclipse.ui.console.MessageConsoleStream;
 import org.yakindu.sct.generator.core.impl.IGeneratorLog;
 
+/**
+ * @author Johannes Dicks - Initial contribution and API
+ */
 public class EclipseConsoleLog implements IGeneratorLog {
 	
 	public static final String SCT_GENERATOR_CONSOLE = "SCT Generator Console";
@@ -46,7 +60,6 @@ public class EclipseConsoleLog implements IGeneratorLog {
 	public void close() throws Throwable {
 		info.close();
 		error.close();
-
 	}
 
 	@Override
@@ -57,7 +70,6 @@ public class EclipseConsoleLog implements IGeneratorLog {
 			printWriter.flush();
 			printWriter.close();
 		}
-
 	}
 
 	@Override