本文整理汇总了Java中springfox.documentation.schema.ModelReference类的典型用法代码示例。如果您正苦于以下问题:Java ModelReference类的具体用法?Java ModelReference怎么用?Java ModelReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelReference类属于springfox.documentation.schema包,在下文中一共展示了ModelReference类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: inputParam
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
private Function<ResolvedType, ? extends ModelReference>
createModelRefFactory(ParameterContext context) {
ModelContext modelContext = inputParam(context.resolvedMethodParameter().getParameterType(),
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
context.getIgnorableParameterTypes());
return modelRefFactory(modelContext, nameExtractor);
}
开发者ID:quanticc,项目名称:sentry,代码行数:10,代码来源:PageableParameterBuilderPlugin.java
示例2: apply
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
@Override
public void apply(ParameterContext context) {
ResolvedMethodParameter parameter = context.resolvedMethodParameter();
Class<?> type = parameter.getParameterType().getErasedType();
if (type != null && Pageable.class.isAssignableFrom(type)) {
Function<ResolvedType, ? extends ModelReference> factory =
createModelRefFactory(context);
ModelReference intModel = factory.apply(resolver.resolve(Integer.TYPE));
ModelReference stringModel = factory.apply(resolver.resolve(List.class, String.class));
List<Parameter> parameters = newArrayList(
context.parameterBuilder()
.parameterType("query").name("page").modelRef(intModel)
.description("Page number of the requested page")
.build(),
context.parameterBuilder()
.parameterType("query").name("size").modelRef(intModel)
.description("Size of a page")
.build(),
context.parameterBuilder()
.parameterType("query").name("sort").modelRef(stringModel).allowMultiple(true)
.description("Sorting criteria in the format: property(,asc|desc). "
+ "Default sort order is ascending. "
+ "Multiple sort criteria are supported.")
.build());
context.getOperationContext().operationBuilder().parameters(parameters);
}
}
开发者ID:quanticc,项目名称:sentry,代码行数:31,代码来源:PageableParameterBuilderPlugin.java
示例3: inputParam
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
private Function<ResolvedType, ? extends ModelReference>
createModelRefFactory(ParameterContext context) {
ModelContext modelContext = inputParam(context.methodParameter().getParameterType(),
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
context.getIgnorableParameterTypes());
return modelRefFactory(modelContext, nameExtractor);
}
开发者ID:stormpath,项目名称:generator-jhipster-stormpath,代码行数:10,代码来源:PageableParameterBuilderPlugin.java
示例4: apply
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
@Override
public void apply(ParameterContext context) {
MethodParameter parameter = context.methodParameter();
Class<?> type = parameter.getParameterType();
if (type != null && Pageable.class.isAssignableFrom(type)) {
Function<ResolvedType, ? extends ModelReference> factory =
createModelRefFactory(context);
ModelReference intModel = factory.apply(resolver.resolve(Integer.TYPE));
ModelReference stringModel = factory.apply(resolver.resolve(List.class, String.class));
List<Parameter> parameters = newArrayList(
context.parameterBuilder()
.parameterType("query").name("page").modelRef(intModel)
.description("Page number of the requested page")
.build(),
context.parameterBuilder()
.parameterType("query").name("size").modelRef(intModel)
.description("Size of a page")
.build(),
context.parameterBuilder()
.parameterType("query").name("sort").modelRef(stringModel).allowMultiple(true)
.description("Sorting criteria in the format: property(,asc|desc). "
+ "Default sort order is ascending. "
+ "Multiple sort criteria are supported.")
.build());
context.getOperationContext().operationBuilder().parameters(parameters);
}
}
开发者ID:stormpath,项目名称:generator-jhipster-stormpath,代码行数:31,代码来源:PageableParameterBuilderPlugin.java
示例5: createModelRefFactory
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
private Function<ResolvedType, ? extends ModelReference> createModelRefFactory(ParameterContext context) {
ModelContext modelContext = inputParam(
context.getGroupName(),
context.resolvedMethodParameter().getParameterType(),
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
context.getIgnorableParameterTypes());
return ResolvedTypes.modelRefFactory(modelContext, nameExtractor);
}
开发者ID:MaritimeConnectivityPlatform,项目名称:IdentityRegistry,代码行数:11,代码来源:OperationPageableParameterReader.java
示例6: createModelRefFactory
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
Function<ResolvedType, ? extends ModelReference> createModelRefFactory(ParameterContext context) {
ModelContext modelContext = inputParam(
context.getGroupName(),
context.resolvedMethodParameter().getParameterType(),
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
context.getIgnorableParameterTypes());
return modelRefFactory(modelContext, nameExtractor);
}
开发者ID:jhipster,项目名称:jhipster,代码行数:11,代码来源:PageableParameterBuilderPlugin.java
示例7: apply
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
@Override
public void apply(OperationContext context) {
List<ResolvedMethodParameter> methodParameters = context.getParameters();
List<Parameter> parameters = newArrayList();
for (ResolvedMethodParameter methodParameter : methodParameters) {
ResolvedType resolvedType = methodParameter.getParameterType();
if (pageableType.equals(resolvedType)) {
ParameterContext parameterContext = new ParameterContext(methodParameter,
new ParameterBuilder(),
context.getDocumentationContext(),
context.getGenericsNamingStrategy(),
context);
Function<ResolvedType, ? extends ModelReference> factory = createModelRefFactory(parameterContext);
ModelReference intModel = factory.apply(resolver.resolve(Integer.TYPE));
ModelReference stringModel = factory.apply(resolver.resolve(List.class, String.class));
parameters.add(new ParameterBuilder()
.parameterType("query")
.name("page")
.modelRef(intModel)
.description("Results page you want to retrieve (0..N)").build());
parameters.add(new ParameterBuilder()
.parameterType("query")
.name("size")
.modelRef(intModel)
.description("Number of records per page").build());
parameters.add(new ParameterBuilder()
.parameterType("query")
.name("sort")
.modelRef(stringModel)
.allowMultiple(true)
.description("Sorting criteria in the format: property(,asc|desc). "
+ "Default sort order is ascending. "
+ "Multiple sort criteria are supported.")
.build());
context.operationBuilder().parameters(parameters);
}
}
}
开发者ID:MaritimeConnectivityPlatform,项目名称:IdentityRegistry,代码行数:43,代码来源:OperationPageableParameterReader.java
示例8: apply
import springfox.documentation.schema.ModelReference; //导入依赖的package包/类
@Override
public void apply(OperationContext context) {
List<ResolvedMethodParameter> methodParameters = context.getParameters();
List<Parameter> parameters = newArrayList();
for (ResolvedMethodParameter methodParameter : methodParameters) {
ResolvedType resolvedType = methodParameter.getParameterType();
if (pageableType.equals(resolvedType)) {
ParameterContext parameterContext = new ParameterContext(methodParameter,
new ParameterBuilder(),
context.getDocumentationContext(),
context.getGenericsNamingStrategy(),
context);
Function<ResolvedType, ? extends ModelReference> factory = createModelRefFactory(parameterContext);
ModelReference intModel = factory.apply(resolver.resolve(Integer.TYPE));
ModelReference stringModel = factory.apply(resolver.resolve(List.class, String.class));
parameters.add(new ParameterBuilder()
.name(PAGE_NAME)
.parameterType(PAGE_TYPE)
.modelRef(intModel)
.description(PAGE_DESCRIPTION)
.build());
parameters.add(new ParameterBuilder()
.name(SIZE_NAME)
.parameterType(SIZE_TYPE)
.modelRef(intModel)
.description(SIZE_DESCRIPTION)
.build());
parameters.add(new ParameterBuilder()
.name(SORT_NAME)
.parameterType(SORT_TYPE)
.modelRef(stringModel)
.allowMultiple(true)
.description(SORT_DESCRIPTION)
.build());
context.operationBuilder().parameters(parameters);
}
}
}
开发者ID:jhipster,项目名称:jhipster,代码行数:46,代码来源:PageableParameterBuilderPlugin.java
注:本文中的springfox.documentation.schema.ModelReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论