Examples of newParser()


Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

        if (Constants.CT_TEXT.equals(mimeType)) {
          message = message + ": " + body;
        } else {
          EncodingEnum enc = EncodingEnum.forContentType(mimeType);
          if (enc != null) {
            IParser p = enc.newParser(theContext);
            try {
              oo = p.parseResource(OperationOutcome.class, body);
              if (oo.getIssueFirstRep().getDetails().isEmpty()==false) {
                message = message + ": " + oo.getIssueFirstRep().getDetails().getValue();
              }
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

    if (outcome != null) {
      EncodingEnum encoding = RestfulServer.determineResponseEncoding(theRequest.getServletRequest());
      servletResponse.setContentType(encoding.getResourceContentType());
      Writer writer = servletResponse.getWriter();
      IParser parser = encoding.newParser(getContext());
      parser.setPrettyPrint(RestfulServer.prettyPrintResponse(theRequest));
      try {
        parser.encodeResourceToWriter(response.getOperationOutcome(), writer);
      } finally {
        writer.close();
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

  /**
   * @throws IOException
   */
  protected IResource parseIncomingServerResource(Request theRequest) throws IOException {
    EncodingEnum encoding = RestfulServer.determineRequestEncoding(theRequest);
    IParser parser = encoding.newParser(getContext());
    IResource resource = parser.parseResource(theRequest.getServletRequest().getReader());
    return resource;
  }

  protected abstract Set<RequestType> provideAllowableRequestTypes();
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

      NonFhirResponseException ex = NonFhirResponseException.newInstance(theResponseStatusCode, theResponseMimeType, theResponseReader);
      populateException(ex, theResponseReader);
      throw ex;
    }
   
    IParser parser=encoding.newParser(getContext());
    return parser;
  }

  public List<IParameter> getParameters() {
    return myParameters;
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

   
    if (encoding==null) {
      throw new InvalidRequestException("Request contins non-FHIR conent-type header value: " + contentTypeHeader);
    }
   
    IParser parser=encoding.newParser(getContext());
    return parser;
  }

  public static boolean verifyMethodHasZeroOrOneOperationAnnotation(Method theNextMethod, Object... theAnnotations) {
    Object obj1 = null;
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

    }

    @Override
    public T invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, BaseServerResponseException {
      EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType);
      IParser parser = respType.newParser(myContext);
      return parser.parseResource(myType, theResponseReader);
    }
  }

  private final class BundleResponseHandler implements IClientResponseHandler<Bundle> {
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

        BaseServerResponseException {
      EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType);
      if (respType == null) {
        throw NonFhirResponseException.newInstance(theResponseStatusCode, theResponseMimeType, theResponseReader);
      }
      IParser parser = respType.newParser(myContext);
      return parser.parseBundle(myType, theResponseReader);
    }
  }

  private class ForInternal implements IQuery {
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

    theResponse.setStatus(Constants.STATUS_HTTP_200_OK);
    theResponse.setCharacterEncoding(Constants.CHARSET_UTF_8);

    theServer.addHeadersToResponse(theResponse);

    IParser parser = responseEncoding.newParser(getContext());
    parser.setPrettyPrint(prettyPrintResponse(theRequest));
    PrintWriter writer = theResponse.getWriter();
    try {
      parser.encodeTagListToWriter(resp, writer);
    } finally {
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

  }

  @Override
  public void invokeServer(RestfulServer theServer, Request theRequest, HttpServletResponse theResponse) throws BaseServerResponseException, IOException {
    EncodingEnum encoding = determineResponseEncoding(theRequest);
    IParser parser = encoding.newParser(getContext());
    IResource resource;
    if (requestContainsResource()) {
      resource = parser.parseResource(theRequest.getInputReader());
      TagList tagList = new TagList();
      for (Enumeration<String> enumeration = theRequest.getServletRequest().getHeaders(Constants.HEADER_CATEGORY); enumeration.hasMoreElements();) {
View Full Code Here

Examples of ca.uhn.fhir.rest.server.EncodingEnum.newParser()

          ourLog.debug("No content in response, not going to read", e);
          reader = null;
        }

        if (reader != null) {
          IParser parser = ct.newParser(theContext);
          IResource outcome = parser.parseResource(reader);
          if (outcome instanceof OperationOutcome) {
            retVal.setOperationOutcome((OperationOutcome) outcome);
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.