Search in sources :

Example 1 with GenericDomValueConvertersRegistry

use of com.intellij.util.xml.converters.values.GenericDomValueConvertersRegistry in project intellij-community by JetBrains.

the class MavenPluginCustomParameterValueConverter method getConverter.

@Override
public Converter getConverter(@NotNull GenericDomValue domElement) {
    Project project = domElement.getManager().getProject();
    JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
    PsiClass psiClass = psiFacade.findClass(myType, GlobalSearchScope.allScope(project));
    if (psiClass != null) {
        GenericDomValueConvertersRegistry convertersRegistry = MavenDomConvertersRegistry.getInstance().getConvertersRegistry();
        return convertersRegistry.getConverter(domElement, psiFacade.getElementFactory().createType(psiClass));
    }
    return null;
}
Also used : JavaPsiFacade(com.intellij.psi.JavaPsiFacade) Project(com.intellij.openapi.project.Project) GenericDomValueConvertersRegistry(com.intellij.util.xml.converters.values.GenericDomValueConvertersRegistry) PsiClass(com.intellij.psi.PsiClass)

Aggregations

Project (com.intellij.openapi.project.Project)1 JavaPsiFacade (com.intellij.psi.JavaPsiFacade)1 PsiClass (com.intellij.psi.PsiClass)1 GenericDomValueConvertersRegistry (com.intellij.util.xml.converters.values.GenericDomValueConvertersRegistry)1