当前位置: 首页>>代码示例>>Java>>正文


Java InjectParam类代码示例

本文整理汇总了Java中com.sun.jersey.api.core.InjectParam的典型用法代码示例。如果您正苦于以下问题:Java InjectParam类的具体用法?Java InjectParam怎么用?Java InjectParam使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InjectParam类属于com.sun.jersey.api.core包,在下文中一共展示了InjectParam类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractParameters

import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
@Override
public List<Parameter> extractParameters(List<Annotation> annotations, Type type, Set<Type> typesToSkip, Iterator<SwaggerExtension> chain) {
    Class<?> cls = TypeUtils.getRawType(type, type);

    List<Parameter> output = new ArrayList<Parameter>();
    if (shouldIgnoreClass(cls) || typesToSkip.contains(type)) {
        // stop the processing chain
        typesToSkip.add(type);
        return output;
    }
    for (Annotation annotation : annotations) {
        if (annotation instanceof BeanParam || annotation instanceof InjectParam) {
            return extractParameters(cls);
        }
    }
    if (chain.hasNext()) {
        return chain.next().extractParameters(annotations, type, typesToSkip, chain);
    }
    return Collections.emptyList();
}
 
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:21,代码来源:BeanParamInjectParamExtention.java

示例2: hasValidAnnotations

import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
private boolean hasValidAnnotations(List<Annotation> parameterAnnotations) {
    // Because method parameters can contain parameters that are valid, but
    // not part of the API contract, first check to make sure the parameter
    // has at lease one annotation before processing it.  Also, check a
    // whitelist to make sure that the annotation of the parameter is
    // compatible with spring-maven-plugin

    List<Type> validParameterAnnotations = new ArrayList<Type>();
    validParameterAnnotations.add(ModelAttribute.class);
    validParameterAnnotations.add(BeanParam.class);
    validParameterAnnotations.add(InjectParam.class);
    validParameterAnnotations.add(ApiParam.class);
    validParameterAnnotations.add(PathParam.class);
    validParameterAnnotations.add(QueryParam.class);
    validParameterAnnotations.add(HeaderParam.class);
    validParameterAnnotations.add(FormParam.class);
    validParameterAnnotations.add(RequestParam.class);
    validParameterAnnotations.add(RequestBody.class);
    validParameterAnnotations.add(PathVariable.class);
    validParameterAnnotations.add(RequestHeader.class);
    validParameterAnnotations.add(RequestPart.class);
    validParameterAnnotations.add(CookieValue.class);


    boolean hasValidAnnotation = false;
    for (Annotation potentialAnnotation : parameterAnnotations) {
        if (validParameterAnnotations.contains(potentialAnnotation.annotationType())) {
            hasValidAnnotation = true;
            break;
        }
    }

    return hasValidAnnotation;
}
 
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:35,代码来源:AbstractReader.java

示例3: updatePetWithFormViaInjectParam

import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
@POST
@Path("/{petId}/testInjectParam")
@Consumes({MediaType.APPLICATION_FORM_URLENCODED})
@ApiOperation(value = "Updates a pet in the store with form data",
        consumes = MediaType.APPLICATION_FORM_URLENCODED)
@ApiResponses(value = {
        @ApiResponse(code = 405, message = "Invalid input")})
public Response updatePetWithFormViaInjectParam(
        @InjectParam MyBean myBean) {
    System.out.println(myBean.getName());
    System.out.println(myBean.getStatus());
    return Response.ok().entity(new com.wordnik.sample.model.ApiResponse(200, "SUCCESS")).build();
}
 
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:14,代码来源:PetResource.java

示例4: AccessControlEditorServlet

import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
@Inject
public AccessControlEditorServlet(@InjectParam GlobalDomainAccessStoreAdmin domainAccessStore,
                                  @InjectParam GlobalDomainAccessControllerProviderImpl domainAccessControllerProvider,
                                  @InjectParam GlobalDomainRoleControllerProviderImpl domainRoleControllerProvider,
                                  @InjectParam GlobalDomainAccessControlListEditorProviderImpl domainAccessControlListEditorProvider) {
    this.domainAccessStore = domainAccessStore;
    this.domainAccessControllerProvider = domainAccessControllerProvider;
    this.domainRoleControllerProvider = domainRoleControllerProvider;
    this.domainAccessControlListEditorProvider = domainAccessControlListEditorProvider;
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:11,代码来源:AccessControlEditorServlet.java

示例5: DefaultContextResolver

import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
public DefaultContextResolver(@InjectParam DefaultObjectMapper objectMapper) {
    om = objectMapper;
}
 
开发者ID:blacklocus,项目名称:jersey-jump,代码行数:4,代码来源:DefaultContextResolver.java


注:本文中的com.sun.jersey.api.core.InjectParam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。