Package javax.ws.rs

Examples of javax.ws.rs.ConsumeMime


        public int compare(ProviderInfo<MessageBodyReader> p1,
                           ProviderInfo<MessageBodyReader> p2) {
            MessageBodyReader e1 = p1.getProvider();
            MessageBodyReader e2 = p2.getProvider();
           
            ConsumeMime c = e1.getClass().getAnnotation(ConsumeMime.class);
            String[] mimeType1 = {"*/*"};
            if (c != null) {
                mimeType1 = c.value();              
            }
           
            ConsumeMime c2 = e2.getClass().getAnnotation(ConsumeMime.class);
            String[] mimeType2 = {"*/*"};
            if (c2 != null) {
                mimeType2 = c2.value();              
            }
   
            return compareString(mimeType1[0], mimeType2[0]);
           
        }
View Full Code Here


       
        return consumeMimes;
    }
   
    private void checkMediaTypes() {
        ConsumeMime cm =
            (ConsumeMime)AnnotationUtils.getMethodAnnotation(annotatedMethod, ConsumeMime.class);
        if (cm != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(cm.value()));
        } else if (classResourceInfo != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getConsumeTypes(classResourceInfo.getConsumeMime()));
        }
       
View Full Code Here

    }
   
    public List<MediaType> getConsumeTypes() {
       
        // this needs to be calculated on init
        ConsumeMime pm =
            (ConsumeMime)JAXRSUtils.getMethodAnnotation(method, ConsumeMime.class);
        if (pm != null) {
            return JAXRSUtils.getMediaTypes(pm.value());
        }
       
        return JAXRSUtils.getConsumeTypes(classResourceInfo.getConsumeMime());
    }
View Full Code Here

    private static class MessageBodyReaderComparator
        implements Comparator<MessageBodyReader> {
       
        public int compare(MessageBodyReader e1, MessageBodyReader e2) {
            ConsumeMime c = e1.getClass().getAnnotation(ConsumeMime.class);
            String[] mimeType1 = {"*/*"};
            if (c != null) {
                mimeType1 = c.value();              
            }
           
            ConsumeMime c2 = e2.getClass().getAnnotation(ConsumeMime.class);
            String[] mimeType2 = {"*/*"};
            if (c2 != null) {
                mimeType2 = c2.value();              
            }
   
            return compareString(mimeType1[0], mimeType2[0]);
           
        }
View Full Code Here

   
    public static List<MediaType> getProviderConsumeTypes(MessageBodyReader provider) {
        String[] values = getUserMediaTypes(provider, "getConsumeMediaTypes");
       
        if (values == null) {
            ConsumeMime c = provider.getClass().getAnnotation(ConsumeMime.class);
            values = c == null ? new String[]{"*/*"} : c.value();
        }
        return JAXRSUtils.getMediaTypes(values);
    }
View Full Code Here

   
    public static List<MediaType> getProviderConsumeTypes(MessageBodyReader provider) {
        String[] values = getUserMediaTypes(provider, "getConsumeMediaTypes");
       
        if (values == null) {
            ConsumeMime c = provider.getClass().getAnnotation(ConsumeMime.class);
            values = c == null ? new String[]{"*/*"} : c.value();
        }
        return JAXRSUtils.getMediaTypes(values);
    }
View Full Code Here

       
        return consumeMimes;
    }
   
    private void checkMediaTypes() {
        ConsumeMime cm =
            (ConsumeMime)AnnotationUtils.getMethodAnnotation(annotatedMethod, ConsumeMime.class);
        if (cm != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(cm.value()));
        } else if (classResourceInfo != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getConsumeTypes(classResourceInfo.getConsumeMime()));
        }
       
View Full Code Here

TOP

Related Classes of javax.ws.rs.ConsumeMime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.