public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return FindAnnotation.findAnnotation(annotations, XopWithMultipartRelated.class) != null || type.isAnnotationPresent(XopWithMultipartRelated.class); }
if (FindAnnotation.findJaxRSAnnotations(ann).length == 0)
@Override public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return FindAnnotation.findAnnotation(annotations, MultipartForm.class) != null || type.isAnnotationPresent(MultipartForm.class); }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return FindAnnotation.findAnnotation(annotations, XopWithMultipartRelated.class) != null || type.isAnnotationPresent(XopWithMultipartRelated.class); }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return List.class.isAssignableFrom(type) && FindAnnotation.findAnnotation(annotations, PartType.class) != null; }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return Map.class.isAssignableFrom(type) && FindAnnotation.findAnnotation(annotations, PartType.class) != null; }
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return FindAnnotation.findAnnotation(annotations, MultipartForm.class) != null || type.isAnnotationPresent(MultipartForm.class); }
public static Class<? extends Annotation>[] findJsonBindingAnnotations(Annotation[] searchList) { LinkedList<Class<? extends Annotation>> result = new LinkedList<Class<? extends Annotation>>(); for (Class<? extends Annotation> clazz : JSON_BINDING_ANNOTATIONS) { if (findAnnotation(searchList, clazz) != null) result.add(clazz); } return result.toArray(findJaxRSAnnotations_TYPE); }
public static Class<? extends Annotation>[] findJaxRSAnnotations(Annotation[] searchList) { LinkedList<Class<? extends Annotation>> result = new LinkedList<Class<? extends Annotation>>(); for (Class<? extends Annotation> clazz : JAXRS_ANNOTATIONS) { if (findAnnotation(searchList, clazz) != null) result.add(clazz); } return result.toArray(findJaxRSAnnotations_TYPE); }
/** * Look for an annotation in a list of annotations. If not there, see if it is on the type provided * * @param type * @param annotations * @param annnotation * @return */ public static <T extends Annotation> T findAnnotation(Class<?> type, Annotation[] annotations, Class<T> annotation) { T config = FindAnnotation.findAnnotation(annotations, annotation); if (config == null) { config = type.getAnnotation(annotation); } return config; }
@Override public boolean isWriteable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) { if (FindAnnotation.findAnnotation(aClass, annotations, NoJackson.class) != null) return false; return super.isWriteable(aClass, type, annotations, mediaType); }
@Override public boolean isReadable(Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType) { if (FindAnnotation.findAnnotation(aClass, annotations, NoJackson.class) != null) return false; return super.isReadable(aClass, type, annotations, mediaType); }
@SuppressWarnings("unchecked") @Override public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations) { if (rawType.equals(Date.class)) { DateFormat format = FindAnnotation.findAnnotation(annotations, DateFormat.class); return (ParamConverter<T>) new DateFormatter(format); } return null; } }
@Override public void setAnnotations(Annotation[] annotations) { DateFormat format = FindAnnotation.findAnnotation(annotations, DateFormat.class); formatter = new SimpleDateFormat(format.value()); }
protected JAXBContext createContextObject(Annotation[] annotations, Class... classes) throws JAXBException { Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class); BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class); if (badger != null) { return new BadgerContext(classes); } else { return new JettisonMappedContext(mapped, classes); } }
public JAXBContext findCachedContext(Class type, MediaType mediaType, Annotation[] annotations) throws JAXBException { Mapped mapped = FindAnnotation.findAnnotation(type, annotations, Mapped.class); BadgerFish badger = FindAnnotation.findAnnotation(type, annotations, BadgerFish.class); if (badger != null) { return find(type, mediaType, badgerCache, mapped, badger); } else { return find(type, mediaType, mappedCache, mapped, badger); } }
@Override protected JAXBContext createContextObject(Annotation[] annotations, String contextPath) throws JAXBException { Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class); BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class); if (badger != null) { return new BadgerContext(contextPath); } else { return new JettisonMappedContext(mapped, contextPath); } }
public JAXBContext findCacheContext(MediaType mediaType, Annotation[] annotations, Class... classes) throws JAXBException { CacheKey key = new CacheKey(classes); Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class); BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class); if (badger != null) { JAXBContext ctx = badgerCollectionCache.get(key); if (ctx != null) return ctx; ctx = new BadgerContext(classes); badgerCollectionCache.put(key, ctx); return ctx; } else { JAXBContext ctx = mappedCollectionCache.get(key); if (ctx != null) return ctx; ctx = new JettisonMappedContext(mapped, classes); mappedCollectionCache.put(key, ctx); return ctx; } }
@Override public JAXBContext findCacheXmlTypeContext(MediaType mediaType, Annotation[] annotations, Class... classes) throws JAXBException { CacheKey key = new CacheKey(classes); Mapped mapped = FindAnnotation.findAnnotation(annotations, Mapped.class); BadgerFish badger = FindAnnotation.findAnnotation(annotations, BadgerFish.class); if (badger != null) { JAXBContext ctx = badgerXmlTypeCollectionCache.get(key); if (ctx != null) return ctx; ctx = createXmlTypeContext(annotations, classes); badgerXmlTypeCollectionCache.put(key, ctx); return ctx; } else { JAXBContext ctx = mappedXmlTypeCollectionCache.get(key); if (ctx != null) return ctx; ctx = createXmlTypeContext(annotations, classes); mappedXmlTypeCollectionCache.put(key, ctx); return ctx; } }
private ValueInjector getParameterExtractor(Class<?> clazz, ResteasyProviderFactory factory, AccessibleObject accessibleObject, Annotation[] annotations, Class<?> type, Type genericType) { boolean extractBody = (FindAnnotation.findAnnotation(annotations, Body.class) != null); ValueInjector injector = factory.getInjectorFactory().createParameterExtractor(clazz, accessibleObject, type, genericType, annotations, extractBody, factory); return injector; }