Class Converters
- java.lang.Object
-
- com._1c.g5.v8.dt.common.databinding.conversion.Converters
-
public class Converters extends Object
Static utility methods and constants pertaining toIConverter
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Converters.DefaultConverter
Default converter implementation, does not perform any conversionstatic class
Converters.FileConverter
Converter from theString
(file name) to theFile
static class
Converters.NameToTextConverter
static class
Converters.StringToBooleanConverter
Converts theString
toBoolean
usingConverters.StringToBooleanConverter
:
"true" -> true
"false" -> false)
trim(source) is empty or null -> null
source not a String -> ClassCastExceptionstatic class
Converters.TrimStringConverter
Trims the input string and return the result
-
Field Summary
Fields Modifier and Type Field Description static org.eclipse.core.databinding.conversion.IConverter
DEFAULT
static org.eclipse.core.databinding.conversion.IConverter
NAME_TO_STRING
static org.eclipse.core.databinding.conversion.IConverter
STR_FILE
static org.eclipse.core.databinding.conversion.IConverter
STR_TO_BOOL
static org.eclipse.core.databinding.conversion.IConverter
STR_TRIM
-
Constructor Summary
Constructors Constructor Description Converters()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.core.databinding.conversion.IConverter
constant(Object value)
Creates a converter that returnsvalue
for any input.static org.eclipse.core.databinding.conversion.IConverter
fromFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Creates a converter that returns value of the feature of the input emf-object.
-
-
-
Field Detail
-
DEFAULT
public static final org.eclipse.core.databinding.conversion.IConverter DEFAULT
- See Also:
Converters.DefaultConverter
-
STR_TO_BOOL
public static final org.eclipse.core.databinding.conversion.IConverter STR_TO_BOOL
- See Also:
Converters.StringToBooleanConverter
-
STR_TRIM
public static final org.eclipse.core.databinding.conversion.IConverter STR_TRIM
- See Also:
Converters.TrimStringConverter
-
STR_FILE
public static final org.eclipse.core.databinding.conversion.IConverter STR_FILE
- See Also:
Converters.FileConverter
-
NAME_TO_STRING
public static final org.eclipse.core.databinding.conversion.IConverter NAME_TO_STRING
- See Also:
Converters.NameToTextConverter
-
-
Method Detail
-
fromFeature
public static org.eclipse.core.databinding.conversion.IConverter fromFeature(org.eclipse.emf.ecore.EStructuralFeature feature)
Creates a converter that returns value of the feature of the input emf-object.- Parameters:
feature
- the emf feature- Returns:
- a emf-feature based converter
-
constant
public static org.eclipse.core.databinding.conversion.IConverter constant(Object value)
Creates a converter that returnsvalue
for any input.- Parameters:
value
- the constant value for the converter to return- Returns:
- a converter that always returns
value
-
-