Package javax.ws.rs

Examples of javax.ws.rs.ProduceMime


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


        } else if (classResourceInfo != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getConsumeTypes(classResourceInfo.getConsumeMime()));
        }
       
        ProduceMime pm =
            (ProduceMime)AnnotationUtils.getMethodAnnotation(annotatedMethod, ProduceMime.class);
        if (pm != null) {
            produceMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(pm.value()));
        } else if (classResourceInfo != null) {
            produceMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getProduceTypes(classResourceInfo.getProduceMime()));
        }
    }
View Full Code Here

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

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

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

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

        } else if (classResourceInfo != null) {
            consumeMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getConsumeTypes(classResourceInfo.getConsumeMime()));
        }
       
        ProduceMime pm =
            (ProduceMime)AnnotationUtils.getMethodAnnotation(annotatedMethod, ProduceMime.class);
        if (pm != null) {
            produceMimes = JAXRSUtils.sortMediaTypes(JAXRSUtils.getMediaTypes(pm.value()));
        } else if (classResourceInfo != null) {
            produceMimes = JAXRSUtils.sortMediaTypes(
                               JAXRSUtils.getProduceTypes(classResourceInfo.getProduceMime()));
        }
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.ProduceMime

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.