class JsonConverter extends AbstractConfigurationConverter {

    public JsonValue convertChild(final @NotNull PlexusConfiguration child, final ExpressionEvaluator evaluator)
            throws ComponentConfigurationException {
        final Object value = fromExpression(child, evaluator);
        final String hint = child.getAttribute("hint");
        if (hint != null) {
            switch (hint.toLowerCase()) {
                case HINT_MAP:
                    return readJsonObjectFromConfig(child, evaluator);
                case HINT_LIST:
                    return readJsonArrayFromConfig(child, evaluator);
                case HINT_STRING:
                    return JavaxJson.wrap(String.valueOf(value));
                case HINT_NUMBER:
                    return JavaxJson.wrap(readNumberFromValue(child.getName(), value));
                case HINT_BOOLEAN:
                    return JavaxJson.wrap(readBooleanFromValue(child.getName(), value));
                case HINT_VALUE_LITERAL:
                    return readJsonValueFromValue(child.getName(), value);
                case HINT_OBJECT_LITERAL:
                    return readJsonObjectFromValue(child.getName(), value);
                case HINT_ARRAY_LITERAL:
                    return readJsonArrayFromValue(child.getName(), value);
                default:
                    throw new ComponentConfigurationException("Unsupported JSON config hint type for key: " +
                            child.getName() + ", hint=" + hint);
            }
        } else if (child.getChildCount() > 0) {
            if (mightBeList(child)) {
                return readJsonArrayFromConfig(child, evaluator);
            } else {
                return readJsonObjectFromConfig(child, evaluator);
            }
        }
        if (value instanceof String) {
            return JavaxJson.val(stringToValue((String) value)).get();
        }
        return JavaxJson.val(value).get();
    }

}