Tabnine Logo
RestfulServerUtils$ResponseEncoding.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
ca.uhn.fhir.rest.server.RestfulServerUtils$ResponseEncoding
constructor

Best Java code snippets using ca.uhn.fhir.rest.server.RestfulServerUtils$ResponseEncoding.<init> (Showing top 10 results out of 315)

origin: jamesagnew/hapi-fhir

private static ResponseEncoding determineRequestEncodingNoDefaultReturnRE(RequestDetails theReq) {
  ResponseEncoding retVal = null;
  List<String> headers = theReq.getHeaders(Constants.HEADER_CONTENT_TYPE);
  if (headers != null) {
    Iterator<String> acceptValues = headers.iterator();
    if (acceptValues != null) {
      while (acceptValues.hasNext() && retVal == null) {
        String nextAcceptHeaderValue = acceptValues.next();
        if (nextAcceptHeaderValue != null && isNotBlank(nextAcceptHeaderValue)) {
          for (String nextPart : nextAcceptHeaderValue.split(",")) {
            int scIdx = nextPart.indexOf(';');
            if (scIdx == 0) {
              continue;
            }
            if (scIdx != -1) {
              nextPart = nextPart.substring(0, scIdx);
            }
            nextPart = nextPart.trim();
            EncodingEnum encoding = EncodingEnum.forContentType(nextPart);
            if (encoding != null) {
              retVal = new ResponseEncoding(theReq.getServer().getFhirContext(), encoding, nextPart);
              break;
            }
          }
        }
      }
    }
  }
  return retVal;
}
origin: jamesagnew/hapi-fhir

EncodingEnum retVal = EncodingEnum.forContentType(nextFormat);
if (retVal != null) {
  return new ResponseEncoding(theReq.getServer().getFhirContext(), retVal, nextFormat);
origin: jamesagnew/hapi-fhir

private static ResponseEncoding getEncodingForContentType(FhirContext theFhirContext, boolean theStrict, String theContentType, String thePreferContentType) {
  EncodingEnum encoding;
  if (theStrict) {
    encoding = EncodingEnum.forContentTypeStrict(theContentType);
  } else {
    encoding = EncodingEnum.forContentType(theContentType);
  }
  if (isNotBlank(thePreferContentType)) {
    if (thePreferContentType.equals(theContentType)) {
      return new ResponseEncoding(theFhirContext, encoding, theContentType);
    }
  }
  if (encoding == null) {
    return null;
  }
  return new ResponseEncoding(theFhirContext, encoding, theContentType);
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

responseEncoding = new ResponseEncoding(theServer.getFhirContext(), theServer.getDefaultResponseEncoding(), null);
origin: ca.uhn.hapi.fhir/hapi-fhir-server

EncodingEnum retVal = EncodingEnum.forContentType(nextFormat);
if (retVal != null) {
  return new ResponseEncoding(theReq.getServer().getFhirContext(), retVal, nextFormat);
origin: ca.uhn.hapi.fhir/hapi-fhir-server

private static ResponseEncoding determineRequestEncodingNoDefaultReturnRE(RequestDetails theReq) {
  ResponseEncoding retVal = null;
  List<String> headers = theReq.getHeaders(Constants.HEADER_CONTENT_TYPE);
  if (headers != null) {
    Iterator<String> acceptValues = headers.iterator();
    if (acceptValues != null) {
      while (acceptValues.hasNext() && retVal == null) {
        String nextAcceptHeaderValue = acceptValues.next();
        if (nextAcceptHeaderValue != null && isNotBlank(nextAcceptHeaderValue)) {
          for (String nextPart : nextAcceptHeaderValue.split(",")) {
            int scIdx = nextPart.indexOf(';');
            if (scIdx == 0) {
              continue;
            }
            if (scIdx != -1) {
              nextPart = nextPart.substring(0, scIdx);
            }
            nextPart = nextPart.trim();
            EncodingEnum encoding = EncodingEnum.forContentType(nextPart);
            if (encoding != null) {
              retVal = new ResponseEncoding(theReq.getServer().getFhirContext(), encoding, nextPart);
              break;
            }
          }
        }
      }
    }
  }
  return retVal;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

private static ResponseEncoding getEncodingForContentType(FhirContext theFhirContext, boolean theStrict, String theContentType, String thePreferContentType) {
  EncodingEnum encoding;
  if (theStrict) {
    encoding = EncodingEnum.forContentTypeStrict(theContentType);
  } else {
    encoding = EncodingEnum.forContentType(theContentType);
  }
  if (isNotBlank(thePreferContentType)) {
    if (thePreferContentType.equals(theContentType)) {
      return new ResponseEncoding(theFhirContext, encoding, theContentType);
    }
  }
  if (encoding == null) {
    return null;
  }
  return new ResponseEncoding(theFhirContext, encoding, theContentType);
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

/**
 * Determine whether a response should be given in JSON or XML format based on the incoming HttpServletRequest's
 * <code>"_format"</code> parameter and <code>"Accept:"</code> HTTP header.
 */
public static ResponseEncoding determineResponseEncodingWithDefault(RequestDetails theReq) {
  ResponseEncoding retVal = determineResponseEncodingNoDefault(theReq, theReq.getServer().getDefaultResponseEncoding());
  if (retVal == null) {
    retVal = new ResponseEncoding(theReq.getServer().getFhirContext(), theReq.getServer().getDefaultResponseEncoding(), null);
  }
  return retVal;
}
origin: jamesagnew/hapi-fhir

responseEncoding = new ResponseEncoding(theServer.getFhirContext(), theServer.getDefaultResponseEncoding(), null);
origin: jamesagnew/hapi-fhir

/**
 * Determine whether a response should be given in JSON or XML format based on the incoming HttpServletRequest's
 * <code>"_format"</code> parameter and <code>"Accept:"</code> HTTP header.
 */
public static ResponseEncoding determineResponseEncodingWithDefault(RequestDetails theReq) {
  ResponseEncoding retVal = determineResponseEncodingNoDefault(theReq, theReq.getServer().getDefaultResponseEncoding());
  if (retVal == null) {
    retVal = new ResponseEncoding(theReq.getServer().getFhirContext(), theReq.getServer().getDefaultResponseEncoding(), null);
  }
  return retVal;
}
ca.uhn.fhir.rest.serverRestfulServerUtils$ResponseEncoding<init>

Popular methods of RestfulServerUtils$ResponseEncoding

  • getEncoding
  • getContentType
  • getResourceContentType
  • isNonLegacy

Popular in Java

  • Making http post requests using okhttp
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now