extension-jaxrs/extension-jaxrs-jakarta/src/main/java/com/alibaba/fastjson2/support/jaxrs/jakarta/FastJson2Feature.java [24:59]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean configure(final FeatureContext context) {
        try {
            final Configuration config = context.getConfiguration();

            final String jsonFeature = CommonProperties.getValue(
                    config.getProperties(),
                    config.getRuntimeType(),
                    InternalProperties.JSON_FEATURE,
                    JSON_FEATURE,
                    String.class
            );

            // Other JSON providers registered.
            if (!JSON_FEATURE.equalsIgnoreCase(jsonFeature)) {
                return false;
            }

            // Disable other JSON providers.
            context.property(
                    PropertiesHelper.getPropertyNameForRuntime(
                            InternalProperties.JSON_FEATURE,
                            config.getRuntimeType()
                    ),
                    JSON_FEATURE
            );

            // Register FastJson.
            if (!config.isRegistered(FastJson2Provider.class)) {
                context.register(FastJson2Provider.class, MessageBodyReader.class, MessageBodyWriter.class);
            }
        } catch (NoSuchMethodError e) {
            // skip
        }

        return true;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



extension-jaxrs/extension-jaxrs-javax/src/main/java/com/alibaba/fastjson2/support/jaxrs/javax/FastJson2Feature.java [25:60]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public boolean configure(final FeatureContext context) {
        try {
            final Configuration config = context.getConfiguration();

            final String jsonFeature = CommonProperties.getValue(
                    config.getProperties(),
                    config.getRuntimeType(),
                    InternalProperties.JSON_FEATURE,
                    JSON_FEATURE,
                    String.class
            );

            // Other JSON providers registered.
            if (!JSON_FEATURE.equalsIgnoreCase(jsonFeature)) {
                return false;
            }

            // Disable other JSON providers.
            context.property(
                    PropertiesHelper.getPropertyNameForRuntime(
                            InternalProperties.JSON_FEATURE,
                            config.getRuntimeType()
                    ),
                    JSON_FEATURE
            );

            // Register FastJson.
            if (!config.isRegistered(FastJson2Provider.class)) {
                context.register(FastJson2Provider.class, MessageBodyReader.class, MessageBodyWriter.class);
            }
        } catch (NoSuchMethodError e) {
            // skip
        }

        return true;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



