本文整理汇总了Java中org.springframework.data.rest.webmvc.BaseUri类的典型用法代码示例。如果您正苦于以下问题:Java BaseUri类的具体用法?Java BaseUri怎么用?Java BaseUri使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseUri类属于org.springframework.data.rest.webmvc包,在下文中一共展示了BaseUri类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: build
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
public SubmissionEnvelopeMessage build() {
// todo - here, we make link with DUMMY_BASE_URI and then take it out again so clients can fill in domain - must be a better way of doing this!
RepositoryLinkBuilder rlb = new RepositoryLinkBuilder(mappings.getMetadataFor(documentType),
new BaseUri(URI.create(DUMMY_BASE_URI)));
Link link = rlb
.slash(submissionEnvelopeId)
.withRel(mappings.getMetadataFor(documentType).getItemResourceRel());
String callbackLink = link.withSelfRel().getHref().replace(DUMMY_BASE_URI, "");
return new SubmissionEnvelopeMessage(
documentType.getSimpleName().toLowerCase(),
submissionEnvelopeId,
submissionEnvelopeUuid,
callbackLink);
}
开发者ID:HumanCellAtlas,项目名称:ingest-core,代码行数:16,代码来源:SubmissionEnvelopeMessageBuilder.java
示例2: build
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
public MetadataDocumentMessage build() {
// todo - here, we make link with DUMMY_BASE_URI and then take it out again so clients can fill in domain - must be a better way of doing this!
RepositoryLinkBuilder rlb = new RepositoryLinkBuilder(mappings.getMetadataFor(documentType),
new BaseUri(URI.create(DUMMY_BASE_URI)));
Link link = rlb
.slash(metadataDocId)
.withRel(mappings.getMetadataFor(documentType).getItemResourceRel());
String callbackLink = link.withSelfRel().getHref().replace(DUMMY_BASE_URI, "");
return new MetadataDocumentMessage(documentType.getSimpleName().toLowerCase(), metadataDocId, metadataDocUuid, callbackLink);
}
开发者ID:HumanCellAtlas,项目名称:ingest-core,代码行数:12,代码来源:MetadataDocumentMessageBuilder.java
示例3: testWithCustomBasePath
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
@Test
public void testWithCustomBasePath() throws Exception {
load(TestConfiguration.class, "spring.data.rest.base-path:foo");
assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class))
.isNotNull();
RepositoryRestConfiguration bean = this.context
.getBean(RepositoryRestConfiguration.class);
URI expectedUri = URI.create("/foo");
assertThat(bean.getBaseUri()).as("Custom basePath not set")
.isEqualTo(expectedUri);
BaseUri baseUri = this.context.getBean(BaseUri.class);
assertThat(expectedUri).as("Custom basePath has not been applied to BaseUri bean")
.isEqualTo(baseUri.getUri());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:RepositoryRestMvcAutoConfigurationTests.java
示例4: calculateValueListUri
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
private String calculateValueListUri(PropertyFactoryContext context) {
ValueListKey valueListValue = getAnnotation(context, ValueListKey.class);
String valueListKey = valueListValue.value();
final BaseUri baseUri = new BaseUri("http://" + moduleRegistry.getModuleForResource("valueLists") + "/valueLists");
UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
return builder.pathSegment(valueListKey).pathSegment("values").build().toUriString();
}
开发者ID:thomasletsch,项目名称:moserp,代码行数:8,代码来源:ValuePropertyFactory.java
示例5: calculateValueListUri
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
private String calculateValueListUri(PropertyFactoryContext context) {
ResourceAssociation resourceAssociation = getAnnotation(context, ResourceAssociation.class);
String resourceName = resourceAssociation.value();
final BaseUri baseUri = new BaseUri("http://" + moduleRegistry.getModuleForResource(resourceName));
UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
return builder.path(resourceName).build().toUriString();
}
开发者ID:thomasletsch,项目名称:moserp,代码行数:9,代码来源:ResourceAssociationPropertyFactory.java
示例6: testWithCustomBasePath
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
@Test
public void testWithCustomBasePath() throws Exception {
load(TestConfiguration.class, "spring.data.rest.base-path:foo");
assertNotNull(this.context.getBean(RepositoryRestMvcConfiguration.class));
RepositoryRestConfiguration bean = this.context
.getBean(RepositoryRestConfiguration.class);
URI expectedUri = URI.create("/foo");
assertEquals("Custom basePath not set", expectedUri, bean.getBaseUri());
BaseUri baseUri = this.context.getBean(BaseUri.class);
assertEquals("Custom basePath has not been applied to BaseUri bean", expectedUri,
baseUri.getUri());
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:RepositoryRestMvcAutoConfigurationTests.java
示例7: getRootPath
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
private String getRootPath() {
BaseUri baseUri = new BaseUri(configuration.getBaseUri());
return baseUri.getUriComponentsBuilder().path(BASE_PATH).build().toString();
}
开发者ID:thomasletsch,项目名称:moserp,代码行数:5,代码来源:ApplicationStructureController.java
示例8: calculateUri
import org.springframework.data.rest.webmvc.BaseUri; //导入依赖的package包/类
private String calculateUri(PropertyFactoryContext context) {
ResourceMetadata mapping = mappings.getMetadataFor(context.getPersistentProperty().getType());
final BaseUri baseUri = new BaseUri("http://" + moduleRegistry.getModuleForResource(mapping.getRel()));
UriComponentsBuilder builder = baseUri.getUriComponentsBuilder();
return builder.path(mapping.getPath().toString()).build().toUriString();
}
开发者ID:thomasletsch,项目名称:moserp,代码行数:7,代码来源:AssociationPropertyFactory.java
注:本文中的org.springframework.data.rest.webmvc.BaseUri类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论