@Override public FeatureContext property(String name, Object value) { return context.property(name, value); }
@Override public FeatureContext property(String name, Object value) { return context.property(name, value); }
@Override public boolean configure(final FeatureContext context) { context.register(OAuth1SignatureFeature.class); context.register(OAuth1ClientFilter.class); context.property(OAuth1ClientSupport.OAUTH_PROPERTY_OAUTH_PARAMETERS, parameters); context.property(OAuth1ClientSupport.OAUTH_PROPERTY_OAUTH_SECRETS, secrets); return true; } }
@Override public boolean configure(FeatureContext context) { if (useEncoding != null) { // properties take precedence over the constructor value if (!context.getConfiguration().getProperties().containsKey(ClientProperties.USE_ENCODING)) { context.property(ClientProperties.USE_ENCODING, useEncoding); } } for (Class<?> provider : encodingProviders) { context.register(provider); } boolean enable = useEncoding != null || encodingProviders.length > 0; if (enable) { context.register(EncodingFilter.class); } return enable; } }
@Override public boolean configure(FeatureContext context) { if (useEncoding != null) { // properties take precedence over the constructor value if (!context.getConfiguration().getProperties().containsKey(ClientProperties.USE_ENCODING)) { context.property(ClientProperties.USE_ENCODING, useEncoding); } } for (Class<?> provider : encodingProviders) { context.register(provider); } boolean enable = useEncoding != null || encodingProviders.length > 0; if (enable) { context.register(EncodingFilter.class); } return enable; } }
context.property( PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()), JSON_FEATURE);
@Override public boolean configure(FeatureContext context) { if (useEncoding != null) { // properties take precedence over the constructor value if (!context.getConfiguration().getProperties().containsKey(ClientProperties.USE_ENCODING)) { context.property(ClientProperties.USE_ENCODING, useEncoding); } } for (Class<?> provider : encodingProviders) { context.register(provider); } boolean enable = useEncoding != null || encodingProviders.length > 0; if (enable) { context.register(EncodingFilter.class); } return enable; } }
@Override public boolean configure(final FeatureContext context) { 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); // add the default Jackson exception mappers context.register(JsonParseExceptionMapper.class); context.register(JsonMappingExceptionMapper.class); context.register(JacksonJaxbJsonProvider.class, MessageBodyReader.class, MessageBodyWriter.class); return true; } }
context.property( PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()) , JSON_FEATURE);
context.property(PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()), JSON_FEATURE);
@Override public boolean configure(final FeatureContext context) { 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); context.register(JsonBindingProvider.class); return true; } }
@Override public boolean configure(final FeatureContext context) { 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); for (final Class<?> provider : PROVIDERS) { context.register(provider, MessageBodyReader.class, MessageBodyWriter.class); } return true; } }
context.property(PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()), JSON_FEATURE);
@Override public boolean configure(final FeatureContext context) { final Configuration config = context.getConfiguration(); // Validation disabled? if (PropertiesHelper.isProperty(config.getProperty(ServerProperties.BV_FEATURE_DISABLE))) { return false; } context.register(new ValidationBinder()); // Set ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR to make sure no sendError is called on servlet container // when ServerProperties.BV_SEND_ERROR_IN_RESPONSE is enabled. if (PropertiesHelper.isProperty(config.getProperty(ServerProperties.BV_SEND_ERROR_IN_RESPONSE)) && config.getProperty(ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR) == null) { context.property(ServerProperties.RESPONSE_SET_STATUS_OVER_SEND_ERROR, true); } return true; } }
context.property( PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()) , JSON_FEATURE);
@Override public boolean configure(FeatureContext featureContext) { for (Map.Entry<String, Object> property : properties.entrySet()) { featureContext = featureContext.property(property.getKey(), property.getValue()); } return true; } };
@Override public boolean configure(FeatureContext configuration) { if (cache == null) cache = new LightweightBrowserCache(); configuration.property(BrowserCache.class.getName(), cache); configuration.register(new CacheInterceptor(cache)); return true; } }
context.property(PropertiesHelper.getPropertyNameForRuntime(InternalProperties.JSON_FEATURE, config.getRuntimeType()), JSON_FEATURE);
@Override public boolean configure(final FeatureContext context) { context.register(OAuth1SignatureFeature.class); context.register(OAuth1ClientFilter.class); context.property(OAuth1ClientSupport.OAUTH_PROPERTY_OAUTH_PARAMETERS, parameters); context.property(OAuth1ClientSupport.OAUTH_PROPERTY_OAUTH_SECRETS, secrets); return true; } }
@Override public boolean configure(FeatureContext configuration) { if (cache == null) cache = new LightweightBrowserCache(); configuration.property(BrowserCache.class.getName(), cache); configuration.register(new CacheInterceptor(cache)); return true; } }