public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; } }
@Override public InjectableScopePair getInjectableiWithScope(AccessibleObject ao, Parameter p, ComponentScope s) { if (p.getAnnotation() == null) return null; p.getAnnotation().annotationType(), ic, p.getAnnotation(), p, ComponentScope.PerRequest); p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.PERREQUEST_UNDEFINED_SINGLETON p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.UNDEFINED_SINGLETON
@Override public InjectableScopePair getInjectableiWithScope(AccessibleObject ao, Parameter p, ComponentScope s) { if (p.getAnnotation() == null) return null; p.getAnnotation().annotationType(), ic, p.getAnnotation(), p, ComponentScope.PerRequest); p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.PERREQUEST_UNDEFINED_SINGLETON p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.UNDEFINED_SINGLETON
@Override public boolean isParameterTypeRegistered(Parameter p) { if (p.getAnnotation() == null) return false; if (isAnnotationRegistered(p.getAnnotation().annotationType(), p.getClass())) return true; return isAnnotationRegistered(p.getAnnotation().annotationType(), p.getParameterType().getClass()); }
@Override public InjectableScopePair getInjectableiWithScope(AccessibleObject ao, Parameter p, ComponentScope s) { if (p.getAnnotation() == null) return null; p.getAnnotation().annotationType(), ic, p.getAnnotation(), p, ComponentScope.PerRequest); p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.PERREQUEST_UNDEFINED_SINGLETON p.getAnnotation().annotationType(), ic, p.getAnnotation(), p.getParameterType(), ComponentScope.UNDEFINED_SINGLETON
@Override protected List<Injectable> getInjectables(AbstractResourceMethod method) { for (int i = 0; i < method.getParameters().size(); i++) { Parameter p = method.getParameters().get(i); if (p.getAnnotation().annotationType() == FormParam.class) { LOGGER.severe("Resource methods utilizing @FormParam " + "and consuming \"multipart/form-data\" are no longer supported. See @FormDataParam."); } } return null; } }
private Parameter unpack(Parameter param) { final Type typeParameter = ((ParameterizedType) param.getParameterType()).getActualTypeArguments()[0]; return new Parameter(param.getAnnotations(), param.getAnnotation(), param.getSource(), param.getSourceName(), typeParameter, (Class<?>) typeParameter, param.isEncoded(), param.getDefaultValue()); }
private List<Injectable> processParameters(AbstractResourceMethod method) { if (method.getParameters().isEmpty()) { return null; } boolean hasFormParam = false; for (int i = 0; i < method.getParameters().size(); i++) { Parameter parameter = method.getParameters().get(i); if (parameter.getAnnotation() != null) hasFormParam |= parameter.getAnnotation().annotationType() == FormParam.class; } if (!hasFormParam) return null; return getInjectables(method); }
/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }
setRepresentationForMediaType(r, m, mediaType, wadlRequest); } else if (p.getAnnotation().annotationType() == FormParam.class) { } else if (p.getAnnotation().annotationType().getName().equals("com.sun.jersey.multipart.FormDataParam")) { // jersey-multipart support
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; } }
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; } }
@Override public boolean isParameterTypeRegistered(Parameter p) { if (p.getAnnotation() == null) return false; if (isAnnotationRegistered(p.getAnnotation().annotationType(), p.getClass())) return true; return isAnnotationRegistered(p.getAnnotation().annotationType(), p.getParameterType().getClass()); }
@Override public boolean isParameterTypeRegistered(Parameter p) { if (p.getAnnotation() == null) return false; if (isAnnotationRegistered(p.getAnnotation().annotationType(), p.getClass())) return true; return isAnnotationRegistered(p.getAnnotation().annotationType(), p.getParameterType().getClass()); }
@Override protected List<Injectable> getInjectables(AbstractResourceMethod method) { for (int i = 0; i < method.getParameters().size(); i++) { Parameter p = method.getParameters().get(i); if (p.getAnnotation().annotationType() == FormParam.class) { LOGGER.severe("Resource methods utilizing @FormParam " + "and consuming \"multipart/form-data\" are no longer supported. See @FormDataParam."); } } return null; } }
@Override protected List<Injectable> getInjectables(AbstractResourceMethod method) { for (int i = 0; i < method.getParameters().size(); i++) { Parameter p = method.getParameters().get(i); if (p.getAnnotation().annotationType() == FormParam.class) { LOGGER.severe("Resource methods utilizing @FormParam " + "and consuming \"multipart/form-data\" are no longer supported. See @FormDataParam."); } } return null; } }
private List<Injectable> processParameters(AbstractResourceMethod method) { if (method.getParameters().isEmpty()) { return null; } boolean hasFormParam = false; for (int i = 0; i < method.getParameters().size(); i++) { Parameter parameter = method.getParameters().get(i); if (parameter.getAnnotation() != null) hasFormParam |= parameter.getAnnotation().annotationType() == FormParam.class; } if (!hasFormParam) return null; return getInjectables(method); }
private List<Injectable> processParameters(AbstractResourceMethod method) { if (method.getParameters().isEmpty()) { return null; } boolean hasFormParam = false; for (int i = 0; i < method.getParameters().size(); i++) { Parameter parameter = method.getParameters().get(i); if (parameter.getAnnotation() != null) hasFormParam |= parameter.getAnnotation().annotationType() == FormParam.class; } if (!hasFormParam) return null; return getInjectables(method); }
/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }
/** * * @param resourceClass * @param method * @param p * @return param doc type */ public ParamDocType getParamDoc( Class<?> resourceClass, Method method, Parameter p ) { final MethodDocType methodDoc = getMethodDoc( resourceClass, method ); if ( methodDoc != null ) { for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) { for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) { final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType(); if ( annotationType != null ) { final String sourceName = getSourceName(annotationDocType); if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) { return paramDocType; } } } } } return null; }