Java 类com.intellij.util.xml.reflect.DomExtender 实例源码

项目:intellij-ce-playground    文件:MavenPluginConfigurationDomExtender.java   
private static void registerPluginParameter(boolean isInPluginManagement, DomExtensionsRegistrar r, final ParameterData data, final String parameterName) {
  DomExtension e = r.registerFixedNumberChildExtension(new XmlName(parameterName), MavenDomConfigurationParameter.class);

  if (isCollection(data.parameter)) {
    e.addExtender(new DomExtender() {
      public void registerExtensions(@NotNull DomElement domElement, @NotNull DomExtensionsRegistrar registrar) {
        for (String each : collectPossibleNameForCollectionParameter(parameterName)) {
          DomExtension inner = registrar.registerCollectionChildrenExtension(new XmlName(each), MavenDomConfigurationParameter.class);
          inner.setDeclaringElement(data.parameter);
        }
      }
    });
  }
  else {
    addValueConverter(e, data.parameter);
    if (!isInPluginManagement) {
      addRequiredAnnotation(e, data);
    }
  }

  e.setDeclaringElement(data.parameter);

  data.parameter.getXmlElement().putUserData(PLUGIN_PARAMETER_KEY, data);
}
项目:tools-idea    文件:MavenPluginConfigurationDomExtender.java   
private static void registerPluginParameter(boolean isInPluginManagement, DomExtensionsRegistrar r, final ParameterData data, final String parameterName) {
  DomExtension e = r.registerFixedNumberChildExtension(new XmlName(parameterName), MavenDomConfigurationParameter.class);

  if (isCollection(data.parameter)) {
    e.addExtender(new DomExtender() {
      public void registerExtensions(@NotNull DomElement domElement, @NotNull DomExtensionsRegistrar registrar) {
        for (String each : collectPossibleNameForCollectionParameter(parameterName)) {
          DomExtension inner = registrar.registerCollectionChildrenExtension(new XmlName(each), MavenDomConfigurationParameter.class);
          inner.setDeclaringElement(data.parameter);
        }
      }
    });
  }
  else {
    addValueConverter(e, data.parameter);
    if (!isInPluginManagement) {
      addRequiredAnnotation(e, data);
    }
  }

  e.setDeclaringElement(data.parameter);

  data.parameter.getXmlElement().putUserData(PLUGIN_PARAMETER_KEY, data);
}
项目:consulo-xml    文件:DomExtensionsTest.java   
public void registerDomExtender(Class<? extends DomExtender<MyElement>> extender) {
  registerDomExtender(MyElement.class, extender);
}
项目:consulo-xml    文件:DomExtensionsTest.java   
public <T extends DomElement> void registerDomExtender(final Class<T> domClass, final Class<? extends DomExtender<T>> extenderClass) {
  final DomExtenderEP extenderEP = new DomExtenderEP();
  extenderEP.domClassName = domClass.getName();
  extenderEP.extenderClassName = extenderClass.getName();
  //TODO [VISTALL] IdeaTestUtil.registerExtension(Extensions.getRootArea(), DomExtenderEP.EP_NAME, extenderEP, myTestRootDisposable);
}