Java 类com.intellij.util.xmlb.JDOMXIncluder 实例源码

项目:consulo    文件:ComponentStoreImpl.java   
@Nullable
protected <T> T getDefaultState(@Nonnull Object component, @Nonnull String componentName, @Nonnull final Class<T> stateClass) {
  URL url = DecodeDefaultsUtil.getDefaults(component, componentName);
  if (url == null) {
    return null;
  }

  try {
    Element documentElement = JDOMXIncluder.resolve(JDOMUtil.loadDocument(url), url.toExternalForm()).detachRootElement();

    PathMacroManager pathMacroManager = getPathMacroManagerForDefaults();
    if (pathMacroManager != null) {
      pathMacroManager.expandPaths(documentElement);
    }

    return DefaultStateSerializer.deserializeState(documentElement, stateClass, null);
  }
  catch (IOException | JDOMException e) {
    throw new StateStorageException("Error loading state from " + url, e);
  }
}
项目:intellij-ce-playground    文件:InclusionProvider.java   
private static XmlTag[] extractXpointer(@NotNull XmlTag rootTag, @Nullable final String xpointer) {
  if (xpointer != null) {
    Matcher matcher = JDOMXIncluder.XPOINTER_PATTERN.matcher(xpointer);
    if (matcher.matches()) {
      String pointer = matcher.group(1);
      matcher = JDOMXIncluder.CHILDREN_PATTERN.matcher(pointer);
      if (matcher.matches() && matcher.group(1).equals(rootTag.getName())) {
        return rootTag.getSubTags();
      }
    }
  }

  return new XmlTag[]{rootTag};
}
项目:tools-idea    文件:InclusionProvider.java   
private static XmlTag[] extractXpointer(@NotNull XmlTag rootTag, @Nullable final String xpointer) {
  if (xpointer != null) {
    Matcher matcher = JDOMXIncluder.XPOINTER_PATTERN.matcher(xpointer);
    if (matcher.matches()) {
      String pointer = matcher.group(1);
      matcher = JDOMXIncluder.CHILDREN_PATTERN.matcher(pointer);
      if (matcher.matches() && matcher.group(1).equals(rootTag.getName())) {
        return rootTag.getSubTags();
      }
    }
  }

  return new XmlTag[]{rootTag};
}
项目:consulo-xml    文件:InclusionProvider.java   
private static XmlTag[] extractXpointer(@NotNull XmlTag rootTag, @Nullable final String xpointer) {
  if (xpointer != null) {
    Matcher matcher = JDOMXIncluder.XPOINTER_PATTERN.matcher(xpointer);
    if (matcher.matches()) {
      String pointer = matcher.group(1);
      matcher = JDOMXIncluder.CHILDREN_PATTERN.matcher(pointer);
      if (matcher.matches() && matcher.group(1).equals(rootTag.getName())) {
        return rootTag.getSubTags();
      }
    }
  }

  return new XmlTag[]{rootTag};
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptorImpl.java   
public void readExternal(@NotNull Document document, @NotNull URL url, boolean ignoreMissingInclude) throws InvalidDataException, FileNotFoundException {
  document = JDOMXIncluder.resolve(document, url.toExternalForm(), ignoreMissingInclude);
  Element rootElement = document.getRootElement();
  JDOMUtil.internElement(rootElement, new StringInterner());
  readExternal(document.getRootElement());
}
项目:tools-idea    文件:IdeaPluginDescriptorImpl.java   
public void readExternal(@NotNull Document document, @NotNull URL url) throws InvalidDataException, FileNotFoundException {
  document = JDOMXIncluder.resolve(document, url.toExternalForm());
  Element rootElement = document.getRootElement();
  internJDOMElement(rootElement);
  readExternal(document.getRootElement());
}
项目:consulo    文件:IdeaPluginDescriptorImpl.java   
public void readExternal(@Nonnull Document document, @Nonnull URL url, boolean ignoreMissingInclude) throws InvalidDataException, FileNotFoundException {
  document = JDOMXIncluder.resolve(document, url.toExternalForm(), ignoreMissingInclude);
  Element rootElement = document.getRootElement();
  JDOMUtil.internStringsInElement(rootElement, new StringInterner());
  readExternal(document.getRootElement());
}