Java 类org.eclipse.xtext.conversion.IValueConverterService 实例源码

项目:xtext-core    文件:QualifiedNameValueConverter.java   
private IValueConverter<Object> initializeDelegateConverter() {
    if (valueConverterService instanceof IValueConverterService.Introspectable) {
        return delegateConverter = ((IValueConverterService.Introspectable) valueConverterService).getConverter(getDelegateRuleName());
    } else {
        final String ruleName = getDelegateRuleName();
        return delegateConverter = new IValueConverter<Object>() {

            @Override
            public Object toValue(String string, INode node) throws ValueConverterException {
                return valueConverterService.toValue(string, ruleName, node);
            }

            @Override
            public String toString(Object value) throws ValueConverterException {
                return valueConverterService.toString(value, ruleName);
            }

        };
    }
}
项目:xtext-core    文件:KeywordAlternativeConverter.java   
private IValueConverter<Object> getDelegateConverter() {
    if (delegateConverter != null) {
        return delegateConverter;
    }
    if (delegateService instanceof IValueConverterService.Introspectable) {
        return delegateConverter = ((IValueConverterService.Introspectable) delegateService).getConverter(delegateRule.getName());
    } else {
        final String ruleName = delegateRule.getName();
        return delegateConverter = new IValueConverter<Object>() {

            @Override
            public Object toValue(String string, INode node) throws ValueConverterException {
                return delegateService.toValue(string, ruleName, node);
            }

            @Override
            public String toString(Object value) throws ValueConverterException {
                return delegateService.toString(value, ruleName);
            }

        };
    }
}
项目:n4js    文件:ImportsAwareReferenceProposalCreator.java   
@Inject
private void setValueConverter(IValueConverterService service, N4JSGrammarAccess grammarAccess) {
    @SuppressWarnings({ "unchecked", "rawtypes" })
    IValueConverter<String> converter = (IValueConverter) ((IValueConverterService.Introspectable) service)
            .getConverter(grammarAccess
                    .getTypeReferenceNameRule()
                    .getName());
    this.valueConverter = converter;
}
项目:xtext-core    文件:ValueConverterForTerminalFragmentsTest.java   
@Test public void testExceptionWhenRegistered() {
    IValueConverterService converters = get(ConverterForFragment.class);
    try {
        converters.toValue("foo", "STRING", null);
    } catch(IllegalStateException e) {
        assertTrue(e.getMessage().contains("ESCAPED_CHAR"));
    }
}
项目:xtext-core    文件:DeclarativeValueConverterServiceTest.java   
@Test public void testDuplicateConverters() {
    IValueConverterService converter = get(DuplicateConverters.class);
    try {
        converter.toString("Foo", "unknown");
        fail("Expected IllegalStateException");
    } catch(IllegalStateException e) {
        assertTrue(e.getMessage().endsWith("'STRING'"));
    }

}
项目:CooperateModelingEnvironment    文件:ValueConverterFragment2.java   
private void registerGuiceBindingsRt() {
    new GuiceModuleAccess.BindingFactory()
            .addTypeToType(typeRef(IValueConverterService.class), getValueConverterName())
            .contributeTo(getLanguage().getRuntimeGenModule());

    Set<String> requiredBundles = getProjectConfig().getRuntime().getManifest().getRequiredBundles();

    requiredBundles.add("de.cooperateproject.modeling.textual.common;visibility:=reexport");
}
项目:OCCI-Studio    文件:AbstractOCCIRuntimeModule.java   
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return Ecore2XtextTerminalConverters.class;
}
项目:xtext-extras    文件:DefaultXbaseRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return XbaseValueConverterService.class;
}
项目:xtext-extras    文件:Ecore2XtextValueConverterServiceFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    return new BindFactory().addTypeToType(IValueConverterService.class.getName(), Ecore2XtextTerminalConverters.class.getName()).getBindings();
}
项目:xtext-extras    文件:AbstractXtextTests.java   
protected IValueConverterService getValueConverterService() {
    return getInjector().getInstance(IValueConverterService.class);
}
项目:minitl    文件:AbstractMinitlRuntimeModule.java   
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return Ecore2XtextTerminalConverters.class;
}
项目:xtext-core    文件:DefaultEcoreElementFactory.java   
public IValueConverterService getConverterService() {
    return converterService;
}
项目:xtext-core    文件:DefaultEcoreElementFactory.java   
public void setConverterService(IValueConverterService converterService) {
    this.converterService = converterService;
}
项目:xtext-core    文件:LinkingHelper.java   
public void setValueConverter(IValueConverterService valueConverter) {
    this.valueConverter = valueConverter;
}
项目:xtext-core    文件:XtextRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return XtextValueConverters.class;
}
项目:xtext-core    文件:PartialSerializationTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
  return PartialSerializationTestLanguageValueConverter.class;
}
项目:xtext-core    文件:Ecore2XtextValueConverterServiceFragment2.java   
@Override
public void generate() {
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(IValueConverterService.class), TypeReference.typeRef(Ecore2XtextTerminalConverters.class)).contributeTo(this.getLanguage().getRuntimeGenModule());
}
项目:xtext-core    文件:ParametersTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return Converters.class;
}
项目:xtext-core    文件:HiddenTerminalsTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return TerminalRuleTestLanguageConverters.class;
}
项目:xtext-core    文件:TerminalRulesTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return TerminalRuleTestLanguageConverters.class;
}
项目:xtext-core    文件:XtextTerminalsTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return TerminalRuleTestLanguageConverters.class;
}
项目:xtext-core    文件:AssignmentsTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return AssignmentsValueConverterService.class;
}
项目:xtext-core    文件:DatatypeRulesTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return DatatypeRulesTestLanguageValueConverters.class;
}
项目:xtext-core    文件:DeclarativeValueConverterServiceTest.java   
@Test public void testSimpleIdConverter() {
    IValueConverterService converter = get(SimpleIdConverter.class);
    expectedIdent = "idConverter";
    converter.toValue("Foo", "ID", null);
}
项目:xtext-core    文件:DeclarativeValueConverterServiceTest.java   
@Test public void testOverriddenIdConverter() {
    IValueConverterService converter = get(OverriddenIdConverter.class);
    expectedIdent = "overriddenIdConverter";
    converter.toString("Foo", "ID");
}
项目:xtext-core    文件:ConcreteTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return AbstractTestLanguageValueConverters.class;
}
项目:xtext-core    文件:QualifiedNameTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return QualifiedNameTerminalConverters.class;
}
项目:xtext-core    文件:Bug250313RuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return Converters.class;
}
项目:xtext-core    文件:Bug250313Test.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return MyConverterService.class;
}
项目:xtext-core    文件:AssignmentFinderTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return AFValueConverter.class;
}
项目:xtext-core    文件:SequencerTestLanguageRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return SequencerTestValueConverter.class;
}
项目:xtext-core    文件:AbstractXtextTests.java   
protected IValueConverterService getValueConverterService() {
    return getInjector().getInstance(IValueConverterService.class);
}
项目:xtext-core    文件:Bug362902RuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
    return Bug362902ValueConverters.class;
}
项目:dsl-devkit    文件:ScopeRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
  return ScopeValueConverterService.class;
}
项目:dsl-devkit    文件:FormatRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
  return FormatValueConverterService.class;
}
项目:dsl-devkit    文件:ExpressionRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
  return ExpressionValueConverterService.class;
}
项目:dsl-devkit    文件:AbstractValueConverterServiceTest.java   
/**
 * Returns the {@link IValueConverterService}.
 * 
 * @return the {@link IValueConverterService}, never {@code null}
 */
protected IValueConverterService getValueConverterService() {
  final IValueConverterService valueConverterService = getXtextTestUtil().get(IValueConverterService.class);
  assertNotNull("The IValueConverterService must be registered in order to test it.", valueConverterService);
  return valueConverterService;
}
项目:dsl-devkit    文件:ValidRuntimeModule.java   
@Override
public Class<? extends IValueConverterService> bindIValueConverterService() {
  return ValidValueConverterService.class;
}
项目:bts    文件:AbstractContentProposalProvider.java   
public void setValueConverter(IValueConverterService valueConverter) {
    this.valueConverter = valueConverter;
}
项目:bts    文件:AbstractContentProposalProvider.java   
public IValueConverterService getValueConverter() {
    return valueConverter;
}