org.springframework.hateoas.ResourceProcessor Java Examples

The following examples show how to use org.springframework.hateoas.ResourceProcessor. 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: SpringDataRestConfiguration.java    From spring-in-action-5-samples with Apache License 2.0 6 votes vote down vote up
@Bean
public ResourceProcessor<PagedResources<Resource<Taco>>>
  tacoProcessor(EntityLinks links) {

  return new ResourceProcessor<PagedResources<Resource<Taco>>>() {
    @Override
    public PagedResources<Resource<Taco>> process(
                        PagedResources<Resource<Taco>> resource) {
      resource.add(
          links.linkFor(Taco.class)
               .slash("recent")
               .withRel("recents"));
      return resource;
    }
  };
}
 
Example #2
Source File: Application.java    From spring-cloud-microservice-example with GNU General Public License v3.0 5 votes vote down vote up
@Bean
public ResourceProcessor<Resource<User>> movieProcessor() {
    return new ResourceProcessor<Resource<User>>() {
        @Override
        public Resource<User> process(Resource<User> resource) {

            resource.add(new Link("/movie/movies", "movies"));
            return resource;
        }
    };
}
 
Example #3
Source File: HypermediaConfiguration.java    From spring-content with Apache License 2.0 4 votes vote down vote up
@Bean
public ResourceProcessor<PersistentEntityResource> contentLinksProcessor(Repositories repos, ContentStoreService stores, RestConfiguration config, RepositoryResourceMappings mappings) {
	return new ContentLinksResourceProcessor(repos, stores, config, mappings);
}