@Test(expected = ComponentConfigurationException.class) public void testReadJsonObjectFromValue_throws() throws Exception { converter().readJsonObjectFromValue("key", "some string"); }
JsonValue readJsonObjectFromValue(final String key, final @Nullable Object value) throws ComponentConfigurationException { if (value instanceof JsonObject) { return (JsonObject) value; } else if (value instanceof String) { try (JsonReader reader = Json.createReader(new StringReader((String) value))) { return reader.readObject(); } catch (JsonException e) { throw new ComponentConfigurationException("Failed to parse value for key " + key + " as JsonObject.", e); } } return JsonObject.NULL; }
JsonConverter extends AbstractConfigurationConverter { JsonValue readJsonObjectFromValue(final String key, final @Nullable Object value) throws ComponentConfigurationException { if (value instanceof JsonObject) { return (JsonObject) value; } else if (value instanceof String) { try (JsonReader reader = Json.createReader(new StringReader((String) value))) { return reader.readObject(); } catch (JsonException e) { throw new ComponentConfigurationException("Failed to parse value for key " + key + " as JsonObject.", e); } } return JsonObject.NULL; } }
JsonConverter extends AbstractConfigurationConverter { JsonValue readJsonObjectFromValue(final String key, final @Nullable Object value) throws ComponentConfigurationException { if (value instanceof JsonObject) { return (JsonObject) value; } else if (value instanceof String) { try (JsonReader reader = Json.createReader(new StringReader((String) value))) { return reader.readObject(); } catch (JsonException e) { throw new ComponentConfigurationException("Failed to parse value for key " + key + " as JsonObject.", e); } } return JsonObject.NULL; }  }
JsonConverter extends AbstractConfigurationConverter { JsonValue readJsonObjectFromValue(final String key, final @Nullable Object value) throws ComponentConfigurationException { if (value instanceof JsonObject) { return (JsonObject) value; } else if (value instanceof String) { try (JsonReader reader = Json.createReader(new StringReader((String) value))) { return reader.readObject(); } catch (JsonException e) { throw new ComponentConfigurationException("Failed to parse value for key " + key + " as JsonObject.", e); } } return JsonObject.NULL; }  static String plexusPluralStem(final String key); @Override boolean canConvert(final Class<?> type); @Override Object fromConfiguration(final ConverterLookup lookup,
                                    final PlexusConfiguration configuration,
                                    final Class<?> type,
                                    final Class<?> enclosingType,
                                    final ClassLoader loader,
                                    final ExpressionEvaluator evaluator,
                                    final ConfigurationListener listener); JsonValue convertChild(final @NotNull PlexusConfiguration child, final ExpressionEvaluator evaluator); static Object stringToValue(String string); }
JsonConverter extends AbstractConfigurationConverter { JsonValue readJsonObjectFromValue(final String key, final @Nullable Object value) throws ComponentConfigurationException { if (value instanceof JsonObject) { return (JsonObject) value; } else if (value instanceof String) { try (JsonReader reader = Json.createReader(new StringReader((String) value))) { return reader.readObject(); } catch (JsonException e) { throw new ComponentConfigurationException("Failed to parse value for key " + key + " as JsonObject.", e); } } return JsonObject.NULL; }  static String plexusPluralStem(final String key); @Override boolean canConvert(final Class<?> type); @Override Object fromConfiguration(final ConverterLookup lookup,
                                    final PlexusConfiguration configuration,
                                    final Class<?> type,
                                    final Class<?> enclosingType,
                                    final ClassLoader loader,
                                    final ExpressionEvaluator evaluator,
                                    final ConfigurationListener listener); JsonValue convertChild(final @NotNull PlexusConfiguration child, final ExpressionEvaluator evaluator); static Object stringToValue(String string);  }