Collection<String> (ConvertContext context) { DomElement parent = context.getInvocationElement().getParent(); assert parent != null; List<DomElement> children = DomUtil.getDefinedChildren(parent, true, true); DomElement classElement = ContainerUtil.find(children, domElement -> domElement.getAnnotation(MappingClass.class) != null); if (classElement == null) return Collections.emptyList(); Object value = ((GenericDomValue<?>)classElement).getValue(); if (value == null) return Collections.emptyList(); PsiType type; if (value instanceof PsiType) { type = (PsiType)value; } else if (value instanceof PsiClass) { type = PsiTypesUtil.getClassType((PsiClass)value); } else { LOG.error("wrong type: " + value.getClass()); return Collections.emptyList(); } JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(context.getProject()); SuggestedNameInfo info = codeStyleManager.suggestVariableName(VariableKind.LOCAL_VARIABLE, null, null, type); return Arrays.asList(info.names); }