@NotNull public BaseJspFile getRootContextFile(@NotNull BaseJspFile file) { BaseJspFile rootContext = file; HashSet<BaseJspFile> recursionPreventer = new HashSet<BaseJspFile>(); do { recursionPreventer.add(rootContext); BaseJspFile context = getContextFile(rootContext); if (context == null || recursionPreventer.contains(context)) break; rootContext = context; } while (true); return rootContext; }
public @NotNull BaseJspFile getRootContextFile(@NotNull BaseJspFile file) { BaseJspFile rootContext = file; HashSet<BaseJspFile> recursionPreventer = new HashSet<BaseJspFile>(); do { recursionPreventer.add(rootContext); BaseJspFile context = getContextFile(rootContext); if (context == null || recursionPreventer.contains(context)) break; rootContext = context; } while (true); return rootContext; }
@NotNull public static List<PathReference> getPreludes(BaseJspFile file) { final List<PathReference> result = new SmartList<>(); processMatchingJspGroups(file, group -> { for(GenericDomValue<PathReference> value : group.getIncludePreludes()) { ContainerUtil.addIfNotNull(result, value.getValue()); } return true; }); return result; }
public static List<PathReference> getCodas(BaseJspFile file) { final List<PathReference> result = new SmartList<>(); processMatchingJspGroups(file, group -> { for(GenericDomValue<PathReference> value : group.getIncludeCodas()) { ContainerUtil.addIfNotNull(result, value.getValue()); } return true; }); return result; }
@Nullable public abstract BaseJspFile getContextFile(@NotNull PsiFile file);
public abstract @Nullable BaseJspFile getContextFile(@NotNull PsiFile file);
public abstract BaseJspFile[] getSuitableContextFiles(@NotNull PsiFile file);
public abstract void setContextFile(@NotNull PsiFile file, @Nullable BaseJspFile contextFile);