public class NumberValueConverter<T extends java.lang.Number> extends ResolvingConverter<T>
ResolvingConverter.StringConverter, ResolvingConverter.WrappedResolvingConverter<T>
BOOLEAN_CONVERTER, EMPTY_CONVERTER
INTEGER_CONVERTER
Constructor and Description |
---|
NumberValueConverter(java.lang.Class<T> numberClass,
boolean allowEmpty) |
Modifier and Type | Method and Description |
---|---|
T |
fromString(java.lang.String s,
ConvertContext context) |
java.lang.String |
getErrorMessage(java.lang.String s,
ConvertContext context) |
java.util.Collection<? extends T> |
getVariants(ConvertContext context) |
static java.lang.Number |
parseNumber(java.lang.String text,
java.lang.Class targetClass) |
static java.lang.String |
parseText(java.lang.Number value,
java.lang.Class targetClass) |
java.lang.String |
toString(T value,
ConvertContext context) |
bindReference, canResolveTo, createLookupElement, getAdditionalVariants, getAdditionalVariants, getPsiElement, getQuickFixes, handleElementRename, isReferenceTo, resolve
public NumberValueConverter(java.lang.Class<T> numberClass, boolean allowEmpty)
public T fromString(java.lang.String s, ConvertContext context)
fromString
in class Converter<T extends java.lang.Number>
public java.lang.String toString(T value, ConvertContext context)
public java.lang.String getErrorMessage(java.lang.String s, ConvertContext context)
getErrorMessage
in class ResolvingConverter<T extends java.lang.Number>
s
- string value that couldn't be resolvedcontext
- contextpublic java.util.Collection<? extends T> getVariants(ConvertContext context)
getVariants
in class ResolvingConverter<T extends java.lang.Number>
context
- contextpublic static java.lang.String parseText(java.lang.Number value, java.lang.Class targetClass)
public static java.lang.Number parseNumber(java.lang.String text, java.lang.Class targetClass)