Examples of newParser()


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;
  }

  protected IParser createAppropriateParserForParsingServerRequest(Request theRequest) {
    String contentTypeHeader = theRequest.getServletRequest().getHeader("content-type");
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;
  }

  protected Object[] createParametersForServerRequest(Request theRequest, IResource theResource) {
    Object[] params = new Object[getParameters().size()];
View Full Code Here

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

        }
      }
      if (encoding == null) {
        throw new InvalidRequestException("FHIR client can't determine resource encoding");
      }
      return encoding.newParser(myContext).parseResource(theResourceBody);
    }

    @SuppressWarnings("unchecked")
    @Override
    public T encodedJson() {
View Full Code Here

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

    public Bundle invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, 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 CreateInternal extends BaseClientExecutable<ICreateTyped, MethodOutcome> implements ICreate, ICreateTyped {
View Full Code Here

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

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

    theServer.addHeadersToResponse(response);

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

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

    public OperationOutcome invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, BaseServerResponseException {
      EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType);
      if (respType == null) {
        return null;
      }
      IParser parser = respType.newParser(myContext);
      OperationOutcome retVal;
      try {
        retVal = parser.parseResource(OperationOutcome.class, theResponseReader);
      } catch (DataFormatException e) {
        ourLog.warn("Failed to parse OperationOutcome response", e);
View Full Code Here

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

      }

  @Override
  protected Object parseRequestObject(Request theRequest) throws IOException {
    EncodingEnum encoding = RestfulServer.determineResponseEncoding(theRequest.getServletRequest());
    IParser parser = encoding.newParser(getContext());
    Bundle bundle = parser.parseBundle(theRequest.getServletRequest().getReader());
    return bundle;
  }

  @Override
View Full Code Here

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

    public T invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, BaseServerResponseException {
      EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType);
      if (respType == null) {
        throw NonFhirResponseException.newInstance(theResponseStatusCode, theResponseMimeType, theResponseReader);
      }
      IParser parser = respType.newParser(myContext);
      T retVal = parser.parseResource(myType, theResponseReader);

      if (myId != null) {
        retVal.setId(myId);
      }
View Full Code Here

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

    public TagList invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map<String, List<String>> theHeaders) throws IOException, BaseServerResponseException {
      EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType);
      if (respType == null) {
        throw NonFhirResponseException.newInstance(theResponseStatusCode, theResponseMimeType, theResponseReader);
      }
      IParser parser = respType.newParser(myContext);
      return parser.parseTagList(theResponseReader);
    }
  }

  private final class TransactionExecutable<T> extends BaseClientExecutable<ITransactionTyped<T>, T> implements ITransactionTyped<T> {
View Full Code Here

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

          BaseOutcomeReturningMethodBinding.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.