/
TerminalConverters.java
38 lines (30 loc) · 1.17 KB
/
TerminalConverters.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* #%L
* org.eclipse.emf.eson
* %%
* Copyright (C) 2009 - 2014 Sebastian Benz, Michael Vorburger 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
* #L%
*/
package org.eclipse.emf.eson.conversion;
import java.util.Date;
import org.eclipse.xtext.common.services.DefaultTerminalConverters;
import org.eclipse.xtext.conversion.IValueConverter;
import org.eclipse.xtext.conversion.ValueConverter;
import com.google.inject.Inject;
public class TerminalConverters extends DefaultTerminalConverters {
@Inject protected DATEValueConverter dateValueConverter;
@Inject protected StringOrQualifiedNameWithWildcardValueConverter stringOrQualifiedNameValueConverter;
@ValueConverter(rule = "Date")
public IValueConverter<Date> Date() {
return dateValueConverter;
}
@ValueConverter(rule = "StringOrQualifiedNameWithWildcard")
public IValueConverter<String> StringOrQualifiedName() {
return stringOrQualifiedNameValueConverter;
}
}