final DomElement paramsElement) {
if (!(paramsElement instanceof InterceptorRef)) {
return PsiReference.EMPTY_ARRAY;
}
InterceptorRef interceptorRef = (InterceptorRef) paramsElement;
final InterceptorOrStackBase value = interceptorRef.getName().getValue();
if (!(value instanceof InterceptorStack)) {
return PsiReference.EMPTY_ARRAY;
}
final String text = nameAttributeValue.getValue();
final boolean hasDot = StringUtil.containsChar(text, '.');
final int idx = hasDot ? text.indexOf('.') : text.length();
final String refName = text.substring(0, idx);
final InterceptorStack stack = (InterceptorStack) value;
final InterceptorRef resolvedInterceptorRef =
ContainerUtil.find(stack.getInterceptorRefs(), new Condition<InterceptorRef>() {
@Override
public boolean value(final InterceptorRef ref) {
return Comparing.strEqual(refName, ref.getName().getStringValue());
}
});
final List<PsiReference> customReferences = new ArrayList<PsiReference>(2);
customReferences.add(new InterceptorRefPsiReference(nameAttributeValue,
TextRange.from(1, idx),
resolvedInterceptorRef,
stack));
if (resolvedInterceptorRef == null) {
return ArrayUtil.toObjectArray(customReferences, PsiReference.class);
}
final String propertyText = text.substring(idx + 1, text.length());
final PsiClass paramsClass = resolvedInterceptorRef.getParamsClass();
final BeanPropertyPathReferenceSet beanPropertyPathReferenceSet =
new BeanPropertyPathReferenceSet(propertyText, nameAttributeValue, idx + 2, '.', paramsClass, false);
Collections.addAll(customReferences, beanPropertyPathReferenceSet.getPsiReferences());