public class DotTerminalConverters
extends org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService
Constructor and Description |
---|
DotTerminalConverters() |
Modifier and Type | Method and Description |
---|---|
org.eclipse.xtext.conversion.IValueConverter<java.lang.String> |
COMPASS_PT()
A
ValueConverter for Dot "NUMERAL" terminals:
terminal COMPASS_PT:
'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | 'c' | '_';
|
static boolean |
isQuoted(java.lang.String value)
Tests whether the given
String value is quoted, i.e. has
quotation marks as its first and last character respectively. |
static boolean |
needsToBeQuoted(java.lang.String value)
Tests whether a given
String value should be quoted because it
contains whitespace characters. |
org.eclipse.xtext.conversion.IValueConverter<java.lang.String> |
NUMERAL()
A
ValueConverter for Dot "NUMERAL" terminals:
terminal NUMERAL:
('-')? |
static java.lang.String |
quote(java.lang.String value)
Turns the given
String value into a quoted string, if it is not
already quoted, i.e. adds quotation marks to start and end, and escapes
any contained quotes. |
org.eclipse.xtext.conversion.IValueConverter<java.lang.String> |
QUOTED_STRING()
A
ValueConverter for Dot "QUOTED_STRING" terminals:
terminal QUOTED_STRING:
('"' ('\\' ('b' | 't' | 'n' | 'f' | 'r' | 'u' | '"' | "'" | '\\') | ! |
org.eclipse.xtext.conversion.IValueConverter<java.lang.String> |
STRING()
A
ValueConverter for Dot "STRING" terminals:
terminal STRING:
('a'..' |
static java.lang.String |
unquote(java.lang.String value)
Turns the given
String value into an unquoted string, i.e. |
getConverter, getConverters, getDefaultTerminalConverterFactory, getGrammar, internalRegisterForClass, isConfigurationMethod, recursiveRegisterForClass, registerEFactoryConverters, setDefaultTerminalConverterFactory, setGrammar, toString, toValue
public org.eclipse.xtext.conversion.IValueConverter<java.lang.String> STRING()
ValueConverter
for Dot "STRING" terminals:
terminal STRING: ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*;
String
value converted from a "STRING" terminal.public org.eclipse.xtext.conversion.IValueConverter<java.lang.String> NUMERAL()
ValueConverter
for Dot "NUMERAL" terminals:
terminal NUMERAL: ('-')? ('.' ('0'..'9')+) | ('0'..'9')+ ('.' ('0'..'9')*)?;
String
value converted from a "NUMERAL" terminal.public org.eclipse.xtext.conversion.IValueConverter<java.lang.String> COMPASS_PT()
ValueConverter
for Dot "NUMERAL" terminals:
terminal COMPASS_PT: 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw' | 'c' | '_';
String
value converted from a "NUMERAL" terminal.public org.eclipse.xtext.conversion.IValueConverter<java.lang.String> QUOTED_STRING()
ValueConverter
for Dot "QUOTED_STRING" terminals:
terminal QUOTED_STRING: ('"' ('\\' ('b' | 't' | 'n' | 'f' | 'r' | 'u' | '"' | "'" | '\\') | !('\\' | '"'))* '"');
String
value converted from a "QUOTED_STRING"
terminal.public static boolean needsToBeQuoted(java.lang.String value)
String
value should be quoted because it
contains whitespace characters.value
- The String
value to test.true
if the given value contains whitespace
characters.public static java.lang.String quote(java.lang.String value)
String
value into a quoted string, if it is not
already quoted, i.e. adds quotation marks to start and end, and escapes
any contained quotes.value
- The String
value to quote if needed.String
value in between, or the
unmodified value, if it is already quoted.public static boolean isQuoted(java.lang.String value)
String
value is quoted, i.e. has
quotation marks as its first and last character respectively.value
- The String
value to test.true
if the given value starts and ends with a
quotation mark, false
otherwise.public static java.lang.String unquote(java.lang.String value)
String
value into an unquoted string, i.e.
removes the first and last character if the string starts and ends with a
quotation mark and transfers all escaped quotes into normal quotes.value
- The String
value to unquote if needed.Copyright (c) 2014 itemis AG and others. All rights reserved.