org.eclipse.xtext.conversion.impl
Class AbstractLexerBasedConverter<T>

java.lang.Object
  extended by org.eclipse.xtext.conversion.impl.AbstractValueConverter<T>
      extended by org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter<T>
All Implemented Interfaces:
IValueConverter<T>, IValueConverter.RuleSpecific
Direct Known Subclasses:
AbstractIDValueConverter, AbstractRichTextValueConverter, DefaultTerminalConverter, INTValueConverter, STRINGValueConverter

public abstract class AbstractLexerBasedConverter<T>
extends AbstractValueConverter<T>
implements IValueConverter.RuleSpecific

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.conversion.IValueConverter
IValueConverter.RuleSpecific
 
Field Summary
 
Fields inherited from interface org.eclipse.xtext.conversion.IValueConverter
NO_OP_CONVERTER
 
Constructor Summary
AbstractLexerBasedConverter()
           
 
Method Summary
protected  void assertTokens(T value, org.antlr.runtime.TokenSource tokenSource, java.lang.String escapedString)
           
protected  void assertValidValue(T value)
           
protected  ValueConverterException createTokenContentMismatchException(T value, java.lang.String escapedString, org.antlr.runtime.Token token)
           
protected  ValueConverterException createTokenTypeMismatchException(T value, java.lang.String escapedString, org.antlr.runtime.Token token)
           
protected  Lexer getLexer()
           
protected  com.google.inject.Provider<Lexer> getLexerProvider()
           
protected  AbstractRule getRule()
           
protected  java.lang.String getRuleName()
           
protected  java.lang.String getRuleName(org.antlr.runtime.Token token)
           
protected  java.util.Map<java.lang.Integer,java.lang.String> getTokenDefMap()
           
protected  ITokenDefProvider getTokenDefProvider()
           
protected  org.antlr.runtime.TokenSource getTokenSource(java.lang.String escapedValue)
           
 void setLexerProvider(com.google.inject.Provider<Lexer> lexerProvider)
           
 void setRule(AbstractRule rule)
           
 void setTokenDefProvider(ITokenDefProvider tokenDefProvider)
           
protected  java.lang.String toEscapedString(T value)
           
 java.lang.String toString(T value)
          Transforms the given value to a string that is conformant to the expected terminal or data type rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.xtext.conversion.IValueConverter
toValue
 

Constructor Detail

AbstractLexerBasedConverter

public AbstractLexerBasedConverter()
Method Detail

toString

public java.lang.String toString(T value)
Description copied from interface: IValueConverter
Transforms the given value to a string that is conformant to the expected terminal or data type rule.

Specified by:
toString in interface IValueConverter<T>
Parameters:
value - the to-be-transformed value
Returns:
a string represenation for that value.

assertTokens

protected void assertTokens(T value,
                            org.antlr.runtime.TokenSource tokenSource,
                            java.lang.String escapedString)

createTokenTypeMismatchException

protected ValueConverterException createTokenTypeMismatchException(T value,
                                                                   java.lang.String escapedString,
                                                                   org.antlr.runtime.Token token)

createTokenContentMismatchException

protected ValueConverterException createTokenContentMismatchException(T value,
                                                                      java.lang.String escapedString,
                                                                      org.antlr.runtime.Token token)

getTokenSource

protected org.antlr.runtime.TokenSource getTokenSource(java.lang.String escapedValue)

assertValidValue

protected void assertValidValue(T value)

getRuleName

protected java.lang.String getRuleName()

toEscapedString

protected java.lang.String toEscapedString(T value)

getLexer

protected Lexer getLexer()

getRuleName

protected java.lang.String getRuleName(org.antlr.runtime.Token token)

getTokenDefMap

protected java.util.Map<java.lang.Integer,java.lang.String> getTokenDefMap()

getRule

protected AbstractRule getRule()

setRule

public void setRule(AbstractRule rule)
Specified by:
setRule in interface IValueConverter.RuleSpecific

setLexerProvider

public void setLexerProvider(com.google.inject.Provider<Lexer> lexerProvider)

setTokenDefProvider

public void setTokenDefProvider(ITokenDefProvider tokenDefProvider)

getTokenDefProvider

protected ITokenDefProvider getTokenDefProvider()

getLexerProvider

protected com.google.inject.Provider<Lexer> getLexerProvider()