public abstract class QuotedValueConverter<T> extends ResolvingConverter<T> implements CustomReferenceConverter<T>
Modifier and Type | Class and Description |
---|---|
protected class |
QuotedValueConverter.MyPsiReference |
ResolvingConverter.StringConverter, ResolvingConverter.WrappedResolvingConverter<T>
Modifier and Type | Field and Description |
---|---|
static char[] |
QUOTE_SIGNS |
BOOLEAN_CONVERTER, EMPTY_CONVERTER
INTEGER_CONVERTER
Constructor and Description |
---|
QuotedValueConverter() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
convertString(java.lang.String string,
ConvertContext context) |
protected abstract java.lang.String |
convertValue(T t,
ConvertContext context) |
protected PsiReference |
createPsiReference(PsiElement element,
int start,
int end,
boolean isSoft,
ConvertContext context,
GenericDomValue<T> genericDomValue,
boolean badQuotation) |
PsiReference [] |
createReferences(GenericDomValue<T> genericDomValue,
PsiElement element,
ConvertContext context)
Will be called on creating
PsiReference s for GenericDomValue
Returned PsiReference s should be soft (PsiReference.isSoft() should return true ). |
T |
fromString(java.lang.String str,
ConvertContext context) |
protected char |
getQuoteSign(T t,
ConvertContext context) |
protected char[] |
getQuoteSigns() |
protected abstract java.lang.Object[] |
getReferenceVariants(ConvertContext context,
GenericDomValue<T> genericDomValue,
TextRange rangeInElement) |
protected abstract java.lang.String |
getUnresolvedMessage(java.lang.String value) |
java.util.Collection<? extends T> |
getVariants(ConvertContext context) |
protected abstract ResolveResult [] |
multiResolveReference(T t,
ConvertContext context) |
static boolean |
quotationIsNotClosed(java.lang.String str) |
java.lang.String |
toString(T ts,
ConvertContext context) |
static java.lang.String |
unquote(java.lang.String str) |
static java.lang.String |
unquote(java.lang.String str,
char[] quoteSigns) |
bindReference, canResolveTo, createLookupElement, getAdditionalVariants, getAdditionalVariants, getErrorMessage, getPsiElement, getQuickFixes, handleElementRename, isReferenceTo, resolve
protected char[] getQuoteSigns()
protected char getQuoteSign(T t, ConvertContext context)
protected abstract T convertString(java.lang.String string, ConvertContext context)
protected abstract java.lang.String convertValue(T t, ConvertContext context)
protected abstract java.lang.Object[] getReferenceVariants(ConvertContext context, GenericDomValue<T> genericDomValue, TextRange rangeInElement)
protected abstract ResolveResult [] multiResolveReference(T t, ConvertContext context)
protected abstract java.lang.String getUnresolvedMessage(java.lang.String value)
public java.util.Collection<? extends T> getVariants(ConvertContext context)
getVariants
in class ResolvingConverter<T>
context
- contextpublic T fromString(java.lang.String str, ConvertContext context)
fromString
in class Converter<T>
public java.lang.String toString(T ts, ConvertContext context)
public PsiReference [] createReferences(GenericDomValue<T> genericDomValue, PsiElement element, ConvertContext context)
CustomReferenceConverter
PsiReference
s for GenericDomValue
Returned PsiReference
s should be soft (PsiReference.isSoft()
should return true
).
To highlight unresolved references, create a DomElementsInspection
and register it.createReferences
in interface CustomReferenceConverter<T>
genericDomValue
- GenericDomValue in questionelement
- corresponding PSI elementcontext
- ConvertContext
PsiReference
s for the valuepublic static java.lang.String unquote(java.lang.String str)
public static java.lang.String unquote(java.lang.String str, char[] quoteSigns)
public static boolean quotationIsNotClosed(java.lang.String str)
protected PsiReference createPsiReference(PsiElement element, int start, int end, boolean isSoft, ConvertContext context, GenericDomValue<T> genericDomValue, boolean badQuotation)