Package org.springframework.hateoas

Examples of org.springframework.hateoas.TemplateVariable


      return TemplateVariables.NONE;
    }

    String description = String.format("pagination.%s.description", sortParameter);
    VariableType type = append ? REQUEST_PARAM_CONTINUED : REQUEST_PARAM;
    return new TemplateVariables(new TemplateVariable(sortParameter, type, description));
  }
View Full Code Here


      if (!queryParameters.containsKey(propertyName)) {

        VariableType type = append ? REQUEST_PARAM_CONTINUED : REQUEST_PARAM;
        String description = String.format("pagination.%s.description", propertyName);
        names.add(new TemplateVariable(propertyName, type, description));
      }
    }

    TemplateVariables pagingVariables = new TemplateVariables(names);
    return pagingVariables.concat(sortResolver.getSortTemplateVariables(parameter, template));
View Full Code Here

      }

      TemplateVariables variables = new TemplateVariables();

      for (ParameterMetadata metadata : mapping.getParametersMetadata()) {
        variables = variables.concat(new TemplateVariable(metadata.getName(), VariableType.REQUEST_PARAM));
      }

      String href = builder.slash(mapping.getPath()).toString().concat(variables.toString());

      Link link = new Link(href, mapping.getRel());
View Full Code Here

    }

    ProjectionDefinitionConfiguration projectionConfiguration = config.projectionConfiguration();

    if (projectionConfiguration.hasProjectionFor(type)) {
      variables = variables.concat(new TemplateVariable(projectionConfiguration.getParameterName(), REQUEST_PARAM));
    }

    return variables.asList().isEmpty() ? linkFor(type).withRel(metadata.getRel()) : new Link(new UriTemplate(href,
        variables), metadata.getRel());
  }
View Full Code Here

    if (!projectionConfiguration.hasProjectionFor(type)) {
      return link;
    }

    String parameterName = projectionConfiguration.getParameterName();
    TemplateVariables templateVariables = new TemplateVariables(new TemplateVariable(parameterName, REQUEST_PARAM));
    UriTemplate template = new UriTemplate(link.getHref(), templateVariables);

    return new Link(template.toString(), metadata.getItemResourceRel());
  }
View Full Code Here

    xdRuntime.add(entityLinks.linkFor(JobExecutionInfoResource.class).withRel("jobs/executions"));
    xdRuntime.add(entityLinks.linkFor(JobInstanceInfoResource.class).withRel("jobs/instances"));


    // Maybe https://github.com/spring-projects/spring-hateoas/issues/169 will help eventually
    TemplateVariable start = new TemplateVariable("start", VariableType.REQUEST_PARAM);
    TemplateVariable lod = new TemplateVariable("detailLevel", VariableType.REQUEST_PARAM_CONTINUED);
    TemplateVariables vars = new TemplateVariables(start, lod);
    for (CompletionKind k : CompletionKind.values()) {
      Object mi = ControllerLinkBuilder.methodOn(CompletionsController.class).completions(k, "", 42);
      Link link = ControllerLinkBuilder.linkTo(mi).withRel(String.format("completions/%s", k));
      String href = link.getHref().substring(0, link.getHref().lastIndexOf('?'));
View Full Code Here

TOP

Related Classes of org.springframework.hateoas.TemplateVariable

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.