public abstract class DelimitedListConverter<T> extends ResolvingConverter<java.util.List<T>> implements CustomReferenceConverter<java.util.List<T>>
Modifier and Type | Class and Description |
---|---|
protected class |
DelimitedListConverter.MyPsiReference |
ResolvingConverter.StringConverter, ResolvingConverter.WrappedResolvingConverter<T>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.Object[] |
EMPTY_ARRAY |
BOOLEAN_CONVERTER, EMPTY_CONVERTER
INTEGER_CONVERTER
Constructor and Description |
---|
DelimitedListConverter(java.lang.String delimiters) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
convertString(java.lang.String string,
ConvertContext context) |
protected PsiReference |
createPsiReference(PsiElement element,
int start,
int end,
ConvertContext context,
GenericDomValue<java.util.List<T>> genericDomValue,
boolean delimitersOnly) |
PsiReference [] |
createReferences(GenericDomValue<java.util.List<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 ). |
static <T> void |
filterVariants(java.util.List<T> variants,
GenericDomValue<? extends java.util.List<T>> genericDomValue) |
java.util.List<T> |
fromString(java.lang.String str,
ConvertContext context) |
protected char |
getDefaultDelimiter() |
protected abstract java.lang.Object[] |
getReferenceVariants(ConvertContext context,
GenericDomValue<? extends java.util.List<T>> genericDomValue) |
protected TextRange |
getTextRange(GenericDomValue value,
int start,
int end) |
protected abstract java.lang.String |
getUnresolvedMessage(java.lang.String value) |
java.util.Collection<? extends java.util.List<T>> |
getVariants(ConvertContext context) |
protected PsiElement |
referenceBindToElement(PsiReference psiReference,
PsiElement element,
Function<? super PsiElement,? extends PsiElement> superBindToElementFunction,
Function<? super java.lang.String,? extends PsiElement> superElementRenameFunction) |
protected PsiElement |
referenceHandleElementRename(PsiReference psiReference,
java.lang.String newName,
Function<? super java.lang.String,? extends PsiElement> superHandleElementRename) |
protected abstract PsiElement |
resolveReference(T t,
ConvertContext context) |
java.lang.String |
toString() |
java.lang.String |
toString(java.util.List<T> ts,
ConvertContext context) |
protected abstract java.lang.String |
toString(T t) |
bindReference, canResolveTo, createLookupElement, getAdditionalVariants, getAdditionalVariants, getErrorMessage, getPsiElement, getQuickFixes, handleElementRename, isReferenceTo, resolve
public DelimitedListConverter(java.lang.String delimiters)
protected abstract T convertString(java.lang.String string, ConvertContext context)
protected abstract java.lang.String toString(T t)
protected abstract java.lang.Object[] getReferenceVariants(ConvertContext context, GenericDomValue<? extends java.util.List<T>> genericDomValue)
protected abstract PsiElement resolveReference(T t, ConvertContext context)
protected abstract java.lang.String getUnresolvedMessage(java.lang.String value)
public java.util.Collection<? extends java.util.List<T>> getVariants(ConvertContext context)
getVariants
in class ResolvingConverter<java.util.List<T>>
context
- contextpublic static <T> void filterVariants(java.util.List<T> variants, GenericDomValue<? extends java.util.List<T>> genericDomValue)
protected char getDefaultDelimiter()
public java.util.List<T> fromString(java.lang.String str, ConvertContext context)
fromString
in class Converter<java.util.List<T>>
public java.lang.String toString(java.util.List<T> ts, ConvertContext context)
public PsiReference [] createReferences(GenericDomValue<java.util.List<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<java.util.List<T>>
genericDomValue
- GenericDomValue in questionelement
- corresponding PSI elementcontext
- ConvertContext
PsiReference
s for the valueprotected PsiReference createPsiReference(PsiElement element, int start, int end, ConvertContext context, GenericDomValue<java.util.List<T>> genericDomValue, boolean delimitersOnly)
protected TextRange getTextRange(GenericDomValue value, int start, int end)
public java.lang.String toString()
toString
in class java.lang.Object
protected PsiElement referenceBindToElement(PsiReference psiReference, PsiElement element, Function<? super PsiElement,? extends PsiElement> superBindToElementFunction, Function<? super java.lang.String,? extends PsiElement> superElementRenameFunction) throws IncorrectOperationException
IncorrectOperationException
protected PsiElement referenceHandleElementRename(PsiReference psiReference, java.lang.String newName, Function<? super java.lang.String,? extends PsiElement> superHandleElementRename) throws IncorrectOperationException
IncorrectOperationException