IJPL-159596 refactor ResourceRegistrar

GitOrigin-RevId: 5a11d285d69adffe92c0ff82d5d56ecdda782f23
This commit is contained in:
Vladimir Krivosheev
2024-08-04 20:36:41 +02:00
committed by intellij-monorepo-bot
parent 0a2d42c6f5
commit e0f3cb0c6c
3 changed files with 14 additions and 8 deletions

View File

@@ -13,5 +13,6 @@
<orderEntry type="module" module-name="intellij.platform.projectModel" />
<orderEntry type="module" module-name="intellij.platform.analysis" />
<orderEntry type="module" module-name="intellij.platform.editor" />
<orderEntry type="library" name="kotlin-stdlib" level="project" />
</component>
</module>

View File

@@ -1,18 +1,19 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.javaee;
package com.intellij.javaee
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.NonNls
/**
* @see StandardResourceProvider
*/
public interface ResourceRegistrar {
void addStdResource(@NotNull @NonNls String resource, @NonNls String fileName);
interface ResourceRegistrar {
fun addStdResource(resource: @NonNls String, fileName: @NonNls String)
void addStdResource(@NotNull @NonNls String resource, @NonNls String fileName, Class<?> klass);
fun addStdResource(resource: @NonNls String, fileName: @NonNls String, classLoader: ClassLoader)
void addStdResource(@NotNull @NonNls String resource, @NonNls String version, @NonNls String fileName, Class<?> klass);
fun addStdResource(resource: @NonNls String, fileName: @NonNls String, klass: Class<*>?)
void addIgnoredResource(@NotNull @NonNls String url);
fun addStdResource(resource: @NonNls String, version: @NonNls String?, fileName: @NonNls String, aClass: Class<*>?)
fun addIgnoredResource(url: @NonNls String)
}

View File

@@ -34,6 +34,10 @@ class ResourceRegistrarImpl : ResourceRegistrar {
addStdResource(resource = resource, version = version, fileName = fileName, aClass = aClass, classLoader = null)
}
override fun addStdResource(resource: @NonNls String, fileName: @NonNls String, classLoader: ClassLoader) {
addStdResource(resource = resource, version = null, fileName = fileName, aClass = null, classLoader = classLoader)
}
override fun addIgnoredResource(url: @NonNls String) {
ignored.add(url)
}