private Class<?> getActualType(Type type, int pos) { Class<?> actual = null; try { actual = InjectionUtils.getActualType(type, pos); } catch (Exception ex) { // ignore; } return actual != null && actual != Object.class ? actual : Attachment.class; }
private Class<?> getActualType(Type type, int pos) { Class<?> actual = null; try { actual = InjectionUtils.getActualType(type, pos); } catch (Exception ex) { // ignore; } return actual != null && actual != Object.class ? actual : Attachment.class; }
public static Class<?> getActualType(Type genericType) { return getActualType(genericType, 0); }
public static Class<?> getActualType(Type genericType) { return getActualType(genericType, 0); }
@Override protected Class<?> getReturnType(Method method, Message outMessage) { Class<?> returnType = super.getReturnType(method, outMessage); if (CompletionStage.class.isAssignableFrom(returnType)) { Type t = method.getGenericReturnType(); returnType = InjectionUtils.getActualType(t); } return returnType; }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return type == GenericHandler.class && InjectionUtils.getActualType(genericType) == Book.class; }
@Override protected Class<?> getReturnType(Method method, Message outMessage) { Class<?> returnType = super.getReturnType(method, outMessage); if (CompletionStage.class.isAssignableFrom(returnType)) { Type t = method.getGenericReturnType(); returnType = InjectionUtils.getActualType(t); } return returnType; }
private boolean objectFactoryForType(Type genericType) { return objectFactoryOrIndexAvailable(InjectionUtils.getActualType(genericType)); }
public boolean isReadable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) { return List.class.isAssignableFrom(arg0) && String.class == InjectionUtils.getActualType(arg1); }
public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType arg3) { return List.class.isAssignableFrom(arg0) && String.class == InjectionUtils.getActualType(arg1); }
protected Class<?> getActualType(Class<?> type, Type genericType, Annotation[] anns) { Class<?> theType = null; if (JAXBElement.class.isAssignableFrom(type)) { theType = InjectionUtils.getActualType(genericType); } else { theType = type; } XmlJavaTypeAdapter adapter = org.apache.cxf.jaxrs.utils.JAXBUtils.getAdapter(theType, anns); theType = org.apache.cxf.jaxrs.utils.JAXBUtils.getTypeFromAdapter(adapter, theType, false); return theType; }
protected Class<?> getActualType(Class<?> type, Type genericType, Annotation[] anns) { Class<?> theType = null; if (JAXBElement.class.isAssignableFrom(type)) { theType = InjectionUtils.getActualType(genericType); } else { theType = type; } XmlJavaTypeAdapter adapter = org.apache.cxf.jaxrs.utils.JAXBUtils.getAdapter(theType, anns); theType = org.apache.cxf.jaxrs.utils.JAXBUtils.getTypeFromAdapter(adapter, theType, false); return theType; }
@Override public void writeTo(StreamingResponse<T> p, Class<?> cls, Type t, Annotation[] anns, MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, WebApplicationException { Class<?> actualCls = InjectionUtils.getActualType(t); if (cls == actualCls) { actualCls = Object.class; } //TODO: review the possibility of caching the providers StreamingResponseWriter thewriter = new StreamingResponseWriter(actualCls, anns, mt, headers, os); p.writeTo(thewriter); }
@Override public void writeTo(StreamingResponse<T> p, Class<?> cls, Type t, Annotation[] anns, MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, WebApplicationException { Class<?> actualCls = InjectionUtils.getActualType(t); if (cls == actualCls) { actualCls = Object.class; } //TODO: review the possibility of caching the providers StreamingResponseWriter thewriter = new StreamingResponseWriter(actualCls, anns, mt, headers, os); p.writeTo(thewriter); }
public boolean isReadable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { if (InjectionUtils.isSupportedCollectionOrArray(type)) { type = InjectionUtils.getActualType(genericType); if (type == null) { return false; } } return canBeReadAsJaxbElement(type) || isSupported(type, genericType, anns); }
public boolean isReadable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { if (InjectionUtils.isSupportedCollectionOrArray(type)) { type = InjectionUtils.getActualType(genericType); if (type == null) { return false; } } return canBeReadAsJaxbElement(type) || isSupported(type, genericType, anns); }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { if (InjectionUtils.isSupportedCollectionOrArray(type)) { type = InjectionUtils.getActualType(genericType); if (type == null) { return false; } } return marshalAsJaxbElement && (!xmlTypeAsJaxbElementOnly || isXmlType(type)) || isSupported(type, genericType, anns); } public void writeTo(T t, Type genericType, Annotation annotations[],
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] anns, MediaType mt) { if (InjectionUtils.isSupportedCollectionOrArray(type)) { type = InjectionUtils.getActualType(genericType); if (type == null) { return false; } } return marshalAsJaxbElement && (!xmlTypeAsJaxbElementOnly || isXmlType(type)) || isSupported(type, genericType, anns); } public void writeTo(T t, Type genericType, Annotation[] annotations,
@Override protected XMLStreamReader createReader(Class<?> type, Type genericType, InputStream is) throws Exception { if (!InjectionUtils.isSupportedCollectionOrArray(type)) { getQName(type); } else { getQName(InjectionUtils.getActualType(genericType)); } return JSONUtils.createStreamReader(is, readXsiType, namespaceMap); }
public void writeTo(GenericHandler<Book> o, Class<?> c, Type t, Annotation[] anns, MediaType m, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException, WebApplicationException { jaxb.writeTo(o.getEntity(), o.getEntity().getClass(), InjectionUtils.getActualType(t), anns, m, headers, os); }