Package com.google.gdata.wireformats.input

Examples of com.google.gdata.wireformats.input.InputProperties


   */
  protected <E> E parseResponseData(GDataRequest req, Class<E> resultType)
      throws IOException, ServiceException {
    Preconditions.checkNotNull("resultType", resultType);

    InputProperties inputProperties =
      new ClientInputProperties(req, resultType);

    AltFormat inputFormat = null;
    String alt = inputProperties.getQueryParameter(GDataProtocol.Parameter.ALT);
    if (alt != null) {
      inputFormat = altRegistry.lookupName(alt);
    }
    if (inputFormat == null) {
      inputFormat = altRegistry.lookupType(inputProperties.getContentType());
      if (inputFormat == null) {
        throw new ParseException("Unrecognized content type:" +
            inputProperties.getContentType());
      }
    }
    InputParser<?> inputParser = altRegistry.getParser(inputFormat);
    if (inputParser == null) {
      throw new ParseException("No parser for content type:" + inputFormat);
    }

    // If a partial representation was requested, use the partial parser
    String fields =
        inputProperties.getQueryParameter(GDataProtocol.Parameter.FIELDS);
    if (fields != null) {
      if (!Element.class.isAssignableFrom(resultType)) {
        throw new IllegalStateException("Unexpected result type: " +
            resultType);
      }
View Full Code Here

TOP

Related Classes of com.google.gdata.wireformats.input.InputProperties

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.