Package org.springframework.data.rest.core.mapping

Examples of org.springframework.data.rest.core.mapping.ResourceMetadata


      results = invoker.invokeFindAll(pageable.getPageable());
    } else {
      results = invoker.invokeFindAll(sort);
    }

    ResourceMetadata metadata = resourceInformation.getResourceMetadata();
    SearchResourceMappings searchMappings = metadata.getSearchResourceMappings();
    List<Link> links = new ArrayList<Link>();

    if (searchMappings.isExported()) {
      links.add(entityLinks.linkFor(metadata.getDomainType()).slash(searchMappings.getPath())
          .withRel(searchMappings.getRel()));
    }

    Link baseLink = entityLinks.linkToPagedResource(resourceInformation.getDomainType(), pageable.isDefault() ? null
        : pageable.getPageable());
View Full Code Here


  @Override
  public Object projectExcerpt(Object source) {

    Assert.notNull(source, "Projection source must not be null!");

    ResourceMetadata metadata = mappings.getMappingFor(source.getClass());
    Class<?> projection = metadata == null ? null : metadata.getExcerptProjection();

    if (projection == null) {
      return project(source);
    }
View Full Code Here

   * @see org.springframework.data.rest.webmvc.support.Projector#hasExcerptProjection(java.lang.Class)
   */
  @Override
  public boolean hasExcerptProjection(Class<?> type) {

    ResourceMetadata metadata = mappings.getMappingFor(type);
    return metadata == null ? false : metadata.getExcerptProjection() != null;
  }
View Full Code Here

    RepositoryLinksResource resource = new RepositoryLinksResource();

    for (Class<?> domainType : repositories) {

      ResourceMetadata metadata = mappings.getMappingFor(domainType);
      if (metadata.isExported()) {
        resource.add(entityLinks.linkToCollectionResource(domainType));
      }
    }

    return new ResponseEntity<RepositoryLinksResource>(resource, HttpStatus.OK);
View Full Code Here

  }

  private PersistentProperty<?> exposeProperty(String name) {

    MongoPersistentProperty property = entity.getPersistentProperty(name);
    ResourceMetadata metadata = new MappingResourceMetadata(mappingContext.getPersistentEntity(property));

    when(mappings.getMappingFor(property.getActualType())).thenReturn(metadata);

    return property;
  }
View Full Code Here

        return DomainTypeAdministrationConfiguration.class.isAssignableFrom(parameter.getParameterType());
    }

    @Override
    public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
        ResourceMetadata resourceMetadata = resourceMetadataResolver.resolveArgument(parameter, mavContainer, webRequest, binderFactory);

        return configuration.forManagedDomainType(resourceMetadata.getDomainType());
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.core.mapping.ResourceMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.