org.glassfish.jersey.message.filtering.EntityFilteringFeature Java Examples

The following examples show how to use org.glassfish.jersey.message.filtering.EntityFilteringFeature. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityFieldsFilteringFeature.java    From ameba with MIT License 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public boolean configure(final FeatureContext context) {
    final Configuration config = context.getConfiguration();

    if (!config.isRegistered(EntityFieldsProcessor.class)) {

        // register EntityFilteringFeature
        if (!config.isRegistered(EntityFilteringFeature.class)) {
            context.register(EntityFilteringFeature.class);
        }
        // Entity Processors.
        context.register(EntityFieldsProcessor.class);
        // Scope Resolver.
        context.register(EntityFieldsScopeResolver.class);

        return true;
    }
    return false;
}
 
Example #2
Source File: DaoGenApplication.java    From dal with Apache License 2.0 5 votes vote down vote up
public DaoGenApplication() throws Exception {
    // 将与ProjectResource同Package的所有Class均注册为Jersey的Resource
    packages(ProjectResource.class.getPackage().getName());
    this.register(EntityFilteringFeature.class);

    Configuration.addResource("conf.properties");
}
 
Example #3
Source File: RestDemoJaxRsApplication.java    From demo-rest-jersey-spring with MIT License 5 votes vote down vote up
/**
	 * Register JAX-RS application components.
	 */
	public RestDemoJaxRsApplication() {
		
        packages("org.codingpedia.demo.rest");
        
//		// register application resources
//		register(PodcastsResource.class);
//		register(PodcastLegacyResource.class);
//
//		// register filters
//		register(RequestContextFilter.class);
//		register(LoggingResponseFilter.class);
//		register(CORSResponseFilter.class);
//
//		// register exception mappers
//		register(GenericExceptionMapper.class);
//		register(AppExceptionMapper.class);
//      register(CustomReasonPhraseExceptionMapper.class);
//		register(NotFoundExceptionMapper.class);
//
//		// register features
//		register(JacksonFeature.class);
		register(EntityFilteringFeature.class);
		EncodingFilter.enableFor(this, GZipEncoder.class);		
		
//		property(EntityFilteringFeature.ENTITY_FILTERING_SCOPE, new Annotation[] {PodcastDetailedView.Factory.get()});
	}