Java 类com.intellij.util.xml.model.DomModelCache 实例源码

项目:intellij-ce-playground    文件:CachedMultipleDomModelFactory.java   
protected CachedMultipleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass,modelMerger);

  myCombinedModelCache = new DomModelCache<M, Scope>(project, name + " combined model") {
    @Override
    @NotNull
    protected CachedValueProvider.Result<M> computeValue(@NotNull final Scope scope) {
      final M combinedModel = computeCombinedModel(scope);
      return new CachedValueProvider.Result<M>(combinedModel, computeDependencies(combinedModel, scope));
    }
  };

  myAllModelsCache = new DomModelCache<List<M>, Scope>(project, name + " models list") {
    @Override
    @NotNull
    protected CachedValueProvider.Result<List<M>> computeValue(@NotNull final Scope scope) {
      final List<M> models = computeAllModels(scope);
      return new CachedValueProvider.Result<List<M>>(models, computeDependencies(null, scope));
    }
  };
}
项目:intellij-ce-playground    文件:CachedSimpleDomModelFactory.java   
protected CachedSimpleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass, modelMerger);

  myModelCache = new DomModelCache<M, XmlFile>(project, name + " model") {
     @Override
     @NotNull
     protected CachedValueProvider.Result<M> computeValue(@NotNull XmlFile file) {
       file = (XmlFile)file.getOriginalFile();

       final Scope scope = getModelScope(file);
       final M model = computeModel(file, scope);
       return new CachedValueProvider.Result<M>(model, computeDependencies(model, scope));
    }
  };
}
项目:tools-idea    文件:CachedMultipleDomModelFactory.java   
protected CachedMultipleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass,modelMerger);

  myCombinedModelCache = new DomModelCache<M, Scope>(project, name + " combined model") {
    @NotNull
    protected CachedValueProvider.Result<M> computeValue(@NotNull final Scope scope) {
      final M combinedModel = computeCombinedModel(scope);
      return new CachedValueProvider.Result<M>(combinedModel, computeDependencies(combinedModel, scope));
    }
  };

  myAllModelsCache = new DomModelCache<List<M>, Scope>(project, name + " models list") {
    @NotNull
    protected CachedValueProvider.Result<List<M>> computeValue(@NotNull final Scope scope) {
      final List<M> models = computeAllModels(scope);
      return new CachedValueProvider.Result<List<M>>(models, computeDependencies(null, scope));
    }
  };
}
项目:tools-idea    文件:CachedSimpleDomModelFactory.java   
protected CachedSimpleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass, modelMerger);

  myModelCache = new DomModelCache<M, XmlFile>(project, name + " model") {
     @NotNull
     protected CachedValueProvider.Result<M> computeValue(@NotNull XmlFile file) {
       file = (XmlFile)file.getOriginalFile();

       final Scope scope = getModelScope(file);
       final M model = computeModel(file, scope);
       return new CachedValueProvider.Result<M>(model, computeDependencies(model, scope));
    }
  };
}
项目:consulo-xml    文件:CachedMultipleDomModelFactory.java   
protected CachedMultipleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass,modelMerger);

  myCombinedModelCache = new DomModelCache<M, Scope>(project, name + " combined model") {
    @NotNull
    protected CachedValueProvider.Result<M> computeValue(@NotNull final Scope scope) {
      final M combinedModel = computeCombinedModel(scope);
      return new CachedValueProvider.Result<M>(combinedModel, computeDependencies(combinedModel, scope));
    }
  };

  myAllModelsCache = new DomModelCache<List<M>, Scope>(project, name + " models list") {
    @NotNull
    protected CachedValueProvider.Result<List<M>> computeValue(@NotNull final Scope scope) {
      final List<M> models = computeAllModels(scope);
      return new CachedValueProvider.Result<List<M>>(models, computeDependencies(null, scope));
    }
  };
}
项目:consulo-xml    文件:CachedSimpleDomModelFactory.java   
protected CachedSimpleDomModelFactory(@NotNull Class<T> aClass,
                        @NotNull ModelMerger modelMerger,
                        final Project project,
                        @NonNls String name) {
  super(aClass, modelMerger);

  myModelCache = new DomModelCache<M, XmlFile>(project, name + " model") {
     @NotNull
     protected CachedValueProvider.Result<M> computeValue(@NotNull XmlFile file) {
       file = (XmlFile)file.getOriginalFile();

       final Scope scope = getModelScope(file);
       final M model = computeModel(file, scope);
       return new CachedValueProvider.Result<M>(model, computeDependencies(model, scope));
    }
  };
}