<commit_before>/**
  Copyright (c) 2012 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:
  	<NAME> - Initial contribution and API
 */
package org.yakindu.sct.generator.java

import com.google.inject.Inject
import org.yakindu.sct.generator.core.features.ICoreFeatureConstants
import org.yakindu.sct.generator.java.features.IJavaFeatureConstants
import org.yakindu.sct.model.sexec.ExecutionFlow
import org.yakindu.sct.model.sgen.FeatureParameterValue
import org.yakindu.sct.model.sgen.GeneratorEntry

class GenmodelEntries {

	@Inject extension Naming

	def private getLicenseFeature(GeneratorEntry it) {
		getFeatureConfiguration(ICoreFeatureConstants::LICENSE_HEADER)
	}

	def private getNamingFeature(GeneratorEntry it) {
		getFeatureConfiguration(IJavaFeatureConstants::NAMING_FEATURE)
	}

	def private getGeneralFeatures(GeneratorEntry it) {
		getFeatureConfiguration(IJavaFeatureConstants::GENERAL_FEATURES)
	}

	def private FeatureParameterValue getBasePackageParameter(GeneratorEntry it) {
		namingFeature?.getParameterValue(IJavaFeatureConstants::BASE_PACKAGE)
	}
	
	def private FeatureParameterValue getImplementationSuffixParameter(GeneratorEntry it) {
		namingFeature?.getParameterValue(IJavaFeatureConstants::IMPLEMENTATION_SUFFIX)
	}

	def private FeatureParameterValue getLicenseTextParameter(GeneratorEntry it) {
		licenseFeature?.getParameterValue(ICoreFeatureConstants::LICENSE_TEXT)
	}

	def private FeatureParameterValue getTimerServiceParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::TIMER_SERVICE)
	}

	def private FeatureParameterValue getRuntimeServiceParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::RUNTIME_SERVICE)
	}

	def private FeatureParameterValue getInterfaceObserverSupportParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::INTERFACE_OBSERVER_SUPPORT)
	}

	def private FeatureParameterValue getUseJavaIntForInteger(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::USE_JAVA_INT_FOR_INTEGER)
	}

	def getLicenseText(GeneratorEntry it) {
		if (licenseTextParameter != null) {
			return "/**" + licenseTextParameter.stringValue + "*/"
		}
		return null
	}

	def getBasePackageName(GeneratorEntry it) {
		if (basePackageParameter != null) {
			return basePackageParameter.stringValue
		}
		return "org.yakindu.scr"
	}

	def getImplementationSuffix(GeneratorEntry it, ExecutionFlow flow) {
		if (implementationSuffixParameter != null) {
			return flow.statemachineName + implementationSuffixParameter.stringValue
		}<commit_msg>Ensure license text of Java generator is preceded and succeeded by single whitespace (as in case of c code generator).<commit_after>/**
  Copyright (c) 2012 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:
  	<NAME> - Initial contribution and API
 */
package org.yakindu.sct.generator.java

import com.google.inject.Inject
import org.yakindu.sct.generator.core.features.ICoreFeatureConstants
import org.yakindu.sct.generator.java.features.IJavaFeatureConstants
import org.yakindu.sct.model.sexec.ExecutionFlow
import org.yakindu.sct.model.sgen.FeatureParameterValue
import org.yakindu.sct.model.sgen.GeneratorEntry

class GenmodelEntries {

	@Inject extension Naming

	def private getLicenseFeature(GeneratorEntry it) {
		getFeatureConfiguration(ICoreFeatureConstants::LICENSE_HEADER)
	}

	def private getNamingFeature(GeneratorEntry it) {
		getFeatureConfiguration(IJavaFeatureConstants::NAMING_FEATURE)
	}

	def private getGeneralFeatures(GeneratorEntry it) {
		getFeatureConfiguration(IJavaFeatureConstants::GENERAL_FEATURES)
	}

	def private FeatureParameterValue getBasePackageParameter(GeneratorEntry it) {
		namingFeature?.getParameterValue(IJavaFeatureConstants::BASE_PACKAGE)
	}
	
	def private FeatureParameterValue getImplementationSuffixParameter(GeneratorEntry it) {
		namingFeature?.getParameterValue(IJavaFeatureConstants::IMPLEMENTATION_SUFFIX)
	}

	def private FeatureParameterValue getLicenseTextParameter(GeneratorEntry it) {
		licenseFeature?.getParameterValue(ICoreFeatureConstants::LICENSE_TEXT)
	}

	def private FeatureParameterValue getTimerServiceParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::TIMER_SERVICE)
	}

	def private FeatureParameterValue getRuntimeServiceParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::RUNTIME_SERVICE)
	}

	def private FeatureParameterValue getInterfaceObserverSupportParameter(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::INTERFACE_OBSERVER_SUPPORT)
	}

	def private FeatureParameterValue getUseJavaIntForInteger(GeneratorEntry it) {
		generalFeatures?.getParameterValue(IJavaFeatureConstants::USE_JAVA_INT_FOR_INTEGER)
	}

	def getLicenseText(GeneratorEntry it) {
		if (licenseTextParameter != null) {
			return "/** " + licenseTextParameter.stringValue.trim + " */"
		}
		return null
	}

	def getBasePackageName(GeneratorEntry it) {
		if (basePackageParameter != null) {
			return basePackageParameter.stringValue
		}
		return "org.yakindu.scr"
	}

	def getImplementationSuffix(GeneratorEntry it, ExecutionFlow flow) {
		if (implementationSuffixParameter != null) {
			return flow.statemachineName + implementationSuffixParameter.stringValue
		}
{'fraction_non_alphanumeric': 0.0718213058419244, 'fraction_numerical': 0.0027491408934707906, 'mean_word_length': 6.823924731182796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5017228', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1615, 'n_words': 323}