private static ExtensionDTO populateExtensionDTO()

in jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/AriesJaxrsServiceRuntime.java [859:895]


    private static ExtensionDTO populateExtensionDTO(
        ExtensionDTO extensionDTO, ExtensionRuntimeInformation eri) {

        populateBaseExtensionDTO(extensionDTO, eri._cachingServiceReference);

        Consumes consumes = AnnotationUtils.getClassAnnotation(
            eri._class, Consumes.class);
        Produces produces = AnnotationUtils.getClassAnnotation(
            eri._class, Produces.class);
        Set<String> nameBindings = AnnotationUtils.getNameBindings(
            eri._class.getAnnotations());

        if (nameBindings.isEmpty()) {
            nameBindings = null;
        }

        extensionDTO.consumes = consumes == null ? null :
            JAXRSUtils.getConsumeTypes(consumes).stream().
                map(
                    MediaType::toString
                ).toArray(
                    String[]::new
                );

        extensionDTO.produces = produces == null ? null :
            JAXRSUtils.getProduceTypes(produces).stream().
                map(
                    MediaType::toString
                ).toArray(
                    String[]::new
                );

        extensionDTO.nameBindings = nameBindings == null ? null :
            nameBindings.toArray(new String[0]);

        return extensionDTO;
    }