diff --git a/json/src/com/jetbrains/jsonSchema/JsonSchemaMappingsProjectConfiguration.java b/json/src/com/jetbrains/jsonSchema/JsonSchemaMappingsProjectConfiguration.java index 6b46c33e0c25..4f1e5431deed 100644 --- a/json/src/com/jetbrains/jsonSchema/JsonSchemaMappingsProjectConfiguration.java +++ b/json/src/com/jetbrains/jsonSchema/JsonSchemaMappingsProjectConfiguration.java @@ -79,7 +79,7 @@ public class JsonSchemaMappingsProjectConfiguration extends JsonSchemaMappingsCo if (schemaFile != null) mySchemaFiles.put(schemaFile, info); } if (refreshStaticProviders) { - ServiceManager.getService(myProject, JsonSchemaService.class).refreshCrossDefinitions(); + ServiceManager.getService(myProject, JsonSchemaService.class).refreshExportedDefinitions(); } } diff --git a/json/src/com/jetbrains/jsonSchema/ide/JsonSchemaService.java b/json/src/com/jetbrains/jsonSchema/ide/JsonSchemaService.java index 238603bd6eb3..3fda2659878d 100644 --- a/json/src/com/jetbrains/jsonSchema/ide/JsonSchemaService.java +++ b/json/src/com/jetbrains/jsonSchema/ide/JsonSchemaService.java @@ -15,9 +15,9 @@ import java.util.List; public interface JsonSchemaService { - void refreshCrossDefinitions(); + void refreshExportedDefinitions(); - void ensureCrossDefinitionsInitialized(); + void ensureExportedDefinitionsInitialized(); class Impl { diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCrossDefinitions.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaExportedDefinitions.java similarity index 85% rename from json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCrossDefinitions.java rename to json/src/com/jetbrains/jsonSchema/impl/JsonSchemaExportedDefinitions.java index bc4d32ef0d1b..70549fada6e8 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaCrossDefinitions.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaExportedDefinitions.java @@ -29,15 +29,15 @@ import static com.jetbrains.jsonSchema.impl.JsonSchemaReader.LOG; /** * @author Irina.Chernushina on 3/28/2016. */ -public class JsonSchemaCrossDefinitions { +public class JsonSchemaExportedDefinitions { private final Map> myMap; private final Project myProject; - public static JsonSchemaCrossDefinitions getInstance(final Project project) { - return ServiceManager.getService(project, JsonSchemaCrossDefinitions.class); + public static JsonSchemaExportedDefinitions getInstance(final Project project) { + return ServiceManager.getService(project, JsonSchemaExportedDefinitions.class); } - public JsonSchemaCrossDefinitions(@NotNull final Project project) { + public JsonSchemaExportedDefinitions(@NotNull final Project project) { myProject = project; myMap = Collections.synchronizedMap(new HashMap<>()); } @@ -50,7 +50,7 @@ public class JsonSchemaCrossDefinitions { } public JsonSchemaObject findDefinition(@NotNull final String url, @NotNull final String relativePart, @NotNull final JsonSchemaObject rootObject) { - ServiceManager.getService(myProject, JsonSchemaService.class).ensureCrossDefinitionsInitialized(); + ServiceManager.getService(myProject, JsonSchemaService.class).ensureExportedDefinitionsInitialized(); final Map map = myMap.get(url); if (map != null) { return JsonSchemaReader.findDefinition(myProject, relativePart, rootObject, map, false); diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaReader.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaReader.java index db67fec1dee4..056fc59ab092 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaReader.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaReader.java @@ -64,7 +64,7 @@ public class JsonSchemaReader { } } - public static void registerObjectsForCrossDefinitions(@Nullable final Project project, @NotNull final JsonSchemaObject object) { + public static void registerObjectsExportedDefinitions(@Nullable final Project project, @NotNull final JsonSchemaObject object) { String id = object.getId(); if (!StringUtil.isEmptyOrSpaces(id)) { id = id.endsWith("#") ? id.substring(0, id.length() - 1) : id; @@ -91,7 +91,7 @@ public class JsonSchemaReader { if (properties != null && !properties.isEmpty()) { map.putAll(convertor.convert("#/properties/", properties)); } - JsonSchemaCrossDefinitions.getInstance(project).register(id, map); + JsonSchemaExportedDefinitions.getInstance(project).register(id, map); } } @@ -161,7 +161,7 @@ public class JsonSchemaReader { if (!processCrossReferences) return null; final String url = ref.substring(0, idx); final String relative = ref.substring(idx); - return JsonSchemaCrossDefinitions.getInstance(project).findDefinition(url, relative, root); + return JsonSchemaExportedDefinitions.getInstance(project).findDefinition(url, relative, root); } ref = ref.substring(2); diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaServiceImpl.java b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaServiceImpl.java index cc4e8ba66e1c..247baab06083 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaServiceImpl.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonSchemaServiceImpl.java @@ -40,11 +40,11 @@ public class JsonSchemaServiceImpl implements JsonSchemaService { @Nullable private final Project myProject; private final ConcurrentMap myWrappers = ContainerUtil.newConcurrentMap(); - private final AtomicBoolean myCrossDefinitionsInitialized; + private final AtomicBoolean myExportedDefinitionsInitialized; public JsonSchemaServiceImpl(@Nullable Project project) { myProject = project; - myCrossDefinitionsInitialized = new AtomicBoolean(); + myExportedDefinitionsInitialized = new AtomicBoolean(); } @NotNull @@ -135,14 +135,14 @@ public class JsonSchemaServiceImpl implements JsonSchemaService { } @Override - public void refreshCrossDefinitions() { - myCrossDefinitionsInitialized.getAndSet(false); - ensureCrossDefinitionsInitialized(); + public void refreshExportedDefinitions() { + myExportedDefinitionsInitialized.getAndSet(false); + ensureExportedDefinitionsInitialized(); } @Override - public void ensureCrossDefinitionsInitialized() { - if (myCrossDefinitionsInitialized.get()) return; + public void ensureExportedDefinitionsInitialized() { + if (myExportedDefinitionsInitialized.get()) return; final JsonSchemaProviderFactory[] factories = getProviderFactories(); for (JsonSchemaProviderFactory factory : factories) { for (JsonSchemaFileProvider provider : factory.getProviders(myProject)) { @@ -150,14 +150,14 @@ public class JsonSchemaServiceImpl implements JsonSchemaService { if (reader == null) continue; try { final JsonSchemaObject resultObject = new JsonSchemaReader(myProject).read(reader, false); - JsonSchemaReader.registerObjectsForCrossDefinitions(myProject, resultObject); + JsonSchemaReader.registerObjectsExportedDefinitions(myProject, resultObject); } catch (IOException e) { logException(provider, e); } } } - myCrossDefinitionsInitialized.getAndSet(true); + myExportedDefinitionsInitialized.getAndSet(true); } @Nullable diff --git a/platform/platform-resources/src/META-INF/JsonPlugin.xml b/platform/platform-resources/src/META-INF/JsonPlugin.xml index 85ec64e4145e..506cfe0318c6 100644 --- a/platform/platform-resources/src/META-INF/JsonPlugin.xml +++ b/platform/platform-resources/src/META-INF/JsonPlugin.xml @@ -66,7 +66,7 @@ instance="com.jetbrains.jsonSchema.JsonSchemaMappingsConfigurable" nonDefaultProject="true"/> - +