org.eclipse.xtext.xbase.conversion.XbaseValueConverterService Java Examples

The following examples show how to use org.eclipse.xtext.xbase.conversion.XbaseValueConverterService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImportsVariableResolver.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void validateParameters(Variable variable, ValidationMessageAcceptor validationMessageAcceptor) {
	if (variable.getParameters().isEmpty()) {
		validationMessageAcceptor.acceptError(getType() + "-variables have mandatory parameters.", variable,
				TemplatesPackage.Literals.VARIABLE__TYPE, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, null);
	} else {
		EList<String> parameters = variable.getParameters();
		for (int i = 0; i < parameters.size(); i++) {
			String param = parameters.get(i);
			try {
				IValueConverter<String> converter = ((XbaseValueConverterService) valueConverterService)
						.getQualifiedNameWithWildCardValueConverter();
				converter.toString(param);
			} catch (ValueConverterException e) {
				validationMessageAcceptor.acceptError(getType() + " - parameter " + param
						+ " is not a valid qualifier.", variable, TemplatesPackage.Literals.VARIABLE__PARAMETERS,
						i, null);
			}
		}
	}
}
 
Example #2
Source File: DefaultXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
	return XbaseValueConverterService.class;
}
 
Example #3
Source File: XtendRuntimeModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends XbaseValueConverterService.IntUnderscoreValueConverter> bindIntUnderscoreValueConverter() {
	return IntUnderscoreValueConverter.class;
}
 
Example #4
Source File: AbstractSARLRuntimeModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends XbaseValueConverterService.IntUnderscoreValueConverter> bindXbaseValueConverterService$IntUnderscoreValueConverter() {
	return IntUnderscoreValueConverter.class;
}