本文整理汇总了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();
}
示例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;
}
示例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();
}
示例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;
}
示例5: DefaultContextResolver
import com.sun.jersey.api.core.InjectParam; //导入依赖的package包/类
public DefaultContextResolver(@InjectParam DefaultObjectMapper objectMapper) {
om = objectMapper;
}