Package org.springframework.data.rest.core.annotation

Examples of org.springframework.data.rest.core.annotation.RestResource


  public RepositoryMethodResourceMapping(Method method, ResourceMapping resourceMapping) {

    Assert.notNull(method, "Method must not be null!");
    Assert.notNull(resourceMapping, "ResourceMapping must not be null!");

    RestResource annotation = AnnotationUtils.findAnnotation(method, RestResource.class);
    String resourceRel = resourceMapping.getRel();

    this.isExported = annotation != null ? annotation.exported() : true;
    this.rel = annotation == null || !StringUtils.hasText(annotation.rel()) ? method.getName() : annotation.rel();
    this.path = annotation == null || !StringUtils.hasText(annotation.path()) ? new Path(method.getName()) : new Path(
        annotation.path());
    this.method = method;
    this.parameterMetadata = discoverParameterMetadata(method, resourceRel.concat(".").concat(rel));

    List<Class<?>> parameterTypes = Arrays.asList(method.getParameterTypes());
View Full Code Here


    }
  }

  private boolean exposes(Method method) {

    RestResource annotation = AnnotationUtils.findAnnotation(method, RestResource.class);
    return annotation == null ? true : annotation.exported();
  }
View Full Code Here

  protected ResourceMappingUtils() {}

  public static String findRel(Class<?> type) {

    RestResource anno = findAnnotation(type, RestResource.class);
    if (anno != null) {
      if (hasText(anno.rel())) {
        return anno.rel();
      }
    }

    return uncapitalize(type.getSimpleName().replaceAll("Repository", ""));
  }
View Full Code Here

    return uncapitalize(type.getSimpleName().replaceAll("Repository", ""));
  }

  public static String findRel(Method method) {

    RestResource anno = findAnnotation(method, RestResource.class);

    if (anno != null) {
      if (hasText(anno.rel())) {
        return anno.rel();
      }
    }

    return method.getName();
  }
View Full Code Here

        (null != propertyMapping ? propertyMapping.getRel() : persistentProperty.getName()));
  }

  public static String findPath(Class<?> type) {

    RestResource anno = findAnnotation(type, RestResource.class);

    if (anno != null) {
      if (hasTextExceptSlash(anno.path())) {
        return removeLeadingSlash(anno.path());
      }
    }

    return uncapitalize(type.getSimpleName().replaceAll("Repository", ""));
  }
View Full Code Here

    return uncapitalize(type.getSimpleName().replaceAll("Repository", ""));
  }

  public static String findPath(Method method) {

    RestResource anno = findAnnotation(method, RestResource.class);

    if (anno != null) {
      if (hasTextExceptSlash(anno.path())) {
        return removeLeadingSlash(anno.path());
      }
    }

    return method.getName();
  }
View Full Code Here

    return method.getName();
  }

  public static boolean findExported(Class<?> type) {
    RestResource anno = findAnnotation(type, RestResource.class);
    return anno == null || anno.exported();
  }
View Full Code Here

    RestResource anno = findAnnotation(type, RestResource.class);
    return anno == null || anno.exported();
  }

  public static boolean findExported(Method method) {
    RestResource anno = findAnnotation(method, RestResource.class);
    return anno == null || anno.exported();
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.core.annotation.RestResource

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.