public Type getType() { return param.getParameterType(); }
private Injectable processEntityParameter( Parameter parameter, Annotation[] annotations) { return new EntityInjectable(parameter.getParameterClass(), parameter.getParameterType(), annotations); } }
@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()); }
private void checkParameter(Parameter p, Object source, String nameForLogging, String paramNameForLogging) { int annotCount = 0; for (Annotation a : p.getAnnotations()) { if (ParamAnnotationSET.contains(a.annotationType())) { annotCount++; if (annotCount > 1) { issueList.add(new ResourceModelIssue( source, ImplMessages.AMBIGUOUS_PARAMETER(nameForLogging, paramNameForLogging), false)); break; } } } final Type t = p.getParameterType(); if (!isConcreteType(t)) { issueList.add(new ResourceModelIssue( source, "Parameter " + paramNameForLogging + " of type " + t + " from " + nameForLogging + " is not resolvable to a concrete type", false)); } }
protected List<Injectable> getInjectables(AbstractResourceMethod method) { List<Injectable> is = new ArrayList<Injectable>(method.getParameters().size()); for (int i = 0; i < method.getParameters().size(); i++) { Parameter p = method.getParameters().get(i); if (Parameter.Source.ENTITY == p.getSource()) { if (MultivaluedMap.class.isAssignableFrom(p.getParameterClass())) { is.add(new FormEntityInjectable(p.getParameterClass(), p.getParameterType(), p.getAnnotations())); } else is.add(null); } else { Injectable injectable = getInjectableProviderContext(). getInjectable(method.getMethod(), p, ComponentScope.PerRequest); is.add(injectable); } } return is; } }
@Override public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p) { return process( w, null, p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }
@Override public MultivaluedParameterExtractor get(Parameter p) { return process( w, p.getDefaultValue(), p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }
public Injectable<?> getInjectable(ComponentContext ic, PathParam a, Parameter c) { String parameterName = c.getSourceName(); if (parameterName == null || parameterName.length() == 0) { // Invalid URI parameter name return null; } if (c.getParameterClass() == PathSegment.class) { return new PathParamPathSegmentInjectable(parameterName, !c.isEncoded()); } else if (c.getParameterClass() == List.class && c.getParameterType() instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType)c.getParameterType(); Type[] targs = pt.getActualTypeArguments(); if (targs.length == 1 && targs[0] == PathSegment.class) { return new PathParamListPathSegmentInjectable( parameterName, !c.isEncoded()); } } MultivaluedParameterExtractor e = getWithoutDefaultValue(c); if (e == null) return null; return new PathParamInjectable(e, !c.isEncoded()); } }
ic, p.getAnnotation(), p.getParameterType(), ComponentScope.PERREQUEST_UNDEFINED_SINGLETON ); ic, p.getAnnotation(), p.getParameterType(), ComponentScope.UNDEFINED_SINGLETON );
private boolean isExtractable(Parameter param) { return param.getParameterClass().isAssignableFrom(Optional.class) && (param.getParameterType() instanceof ParameterizedType) && ((ParameterizedType) param.getParameterType()).getActualTypeArguments().length == 1 && ((ParameterizedType) param.getParameterType()).getActualTypeArguments()[0].equals(ImageOptions.class); } }
private boolean isExtractable(Parameter param) { return (param.getSourceName() != null) && !param.getSourceName().isEmpty() && param.getParameterClass().isAssignableFrom(Optional.class) && (param.getParameterType() instanceof ParameterizedType); }
private Injectable processEntityParameter( Parameter parameter, Annotation[] annotations) { return new EntityInjectable(parameter.getParameterClass(), parameter.getParameterType(), annotations); } }
private Injectable processEntityParameter( Parameter parameter, Annotation[] annotations) { return new EntityInjectable(parameter.getParameterClass(), parameter.getParameterType(), annotations); } }
@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 public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p) { return process( w, null, p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }
@Override public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p) { return process( w, null, p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }
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()); }
@Override public MultivaluedParameterExtractor get(Parameter p) { return process( w, p.getDefaultValue(), p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }
@Override public MultivaluedParameterExtractor get(Parameter p) { return process( w, p.getDefaultValue(), p.getParameterClass(), p.getParameterType(), p.getAnnotations(), p.getSourceName()); }