use of org.eclipse.xtext.util.JavaVersion in project xtext-xtend by eclipse.
the class XtendValidator method checkDuplicateAndOverriddenFunctions.
@Check
public void checkDuplicateAndOverriddenFunctions(XtendTypeDeclaration xtendType) {
final JvmDeclaredType inferredType = associations.getInferredType(xtendType);
if (inferredType instanceof JvmGenericType) {
JavaVersion targetVersion = getGeneratorConfig(xtendType).getJavaSourceVersion();
ResolvedFeatures resolvedFeatures = overrideHelper.getResolvedFeatures(inferredType, targetVersion);
Set<EObject> flaggedOperations = Sets.newHashSet();
doCheckDuplicateExecutables((JvmGenericType) inferredType, resolvedFeatures, flaggedOperations);
doCheckOverriddenMethods(xtendType, (JvmGenericType) inferredType, resolvedFeatures, flaggedOperations);
doCheckFunctionOverrides(resolvedFeatures, flaggedOperations);
}
}
use of org.eclipse.xtext.util.JavaVersion in project xtext-xtend by eclipse.
the class XtendBatchCompiler method setJavaSourceVersion.
/**
* @since 2.8
*/
public void setJavaSourceVersion(final String javaSourceVersion) {
JavaVersion javaVersion = JavaVersion.fromQualifier(javaSourceVersion);
if (javaVersion == null) {
List<String> qualifiers = Lists.newArrayList();
for (JavaVersion version : JavaVersion.values()) qualifiers.addAll(version.getAllQualifiers());
throw new IllegalArgumentException("Unknown Java Version Qualifier: '" + javaSourceVersion + "'. Valid values are: '" + Joiner.on(", ").join(qualifiers) + "'");
}
generatorConfig.setJavaSourceVersion(javaVersion);
}
Aggregations