Package org.codehaus.enunciate.contract.jaxrs

Examples of org.codehaus.enunciate.contract.jaxrs.ResourceMethodMediaType


    LinkedHashMap<String, ResourceMethodMediaType> supported = new LinkedHashMap<String, ResourceMethodMediaType>();
    for (ResourceMethod resource : resourceList) {
      for (ResourceMethodMediaType mediaType : resource.getApplicableMediaTypes()) {
        for (String applicableType : findAllKnownTypesAcceptableTo(mediaType)) {
          ResourceMethodMediaType type = supported.get(applicableType);
          if (type == null) {
            type = new ResourceMethodMediaType();
            type.setType(applicableType);
            supported.put(applicableType, type);
          }

          type.setProduceable(type.isProduceable() || mediaType.isProduceable());
          type.setConsumable(type.isConsumable() || mediaType.isConsumable());

          if (mediaType.isProduceable()) {
            //if the media type is produceable, we want to add any subcontexts
            //where the type might be mounted. This will only happen for
            //the media types that have ids.
            Map<String, Set<String>> subcontextMap = (Map<String, Set<String>>) resource.getMetaData().get("subcontexts");
            if (subcontextMap != null) {
              type.setSubcontexts(subcontextMap.get(applicableType));
            }
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.contract.jaxrs.ResourceMethodMediaType

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.