Package org.apache.hadoop.fs.swift.exceptions

Examples of org.apache.hadoop.fs.swift.exceptions.SwiftJsonMarshallingException


  public static <T> T toObject(String value, Class<T> klazz) throws
                                                             IOException {
    try {
      return jsonMapper.readValue(value, klazz);
    } catch (JsonGenerationException e) {
      throw new SwiftJsonMarshallingException(e.toString()
                                              + " source: " + value,
                                              e);
    } catch (JsonMappingException e) {
      throw new SwiftJsonMarshallingException(e.toString()
                                              + " source: " + value,
                                              e);
    }
  }
View Full Code Here


                               final TypeReference<T> typeReference)
            throws IOException {
    try {
      return (T)jsonMapper.readValue(value, typeReference);
    } catch (JsonGenerationException e) {
      throw new SwiftJsonMarshallingException("Error generating response", e);
    } catch (JsonMappingException e) {
      throw new SwiftJsonMarshallingException("Error generating response", e);
    }
  }
View Full Code Here

                               final CollectionType collectionType)
              throws IOException {
    try {
      return (T)jsonMapper.readValue(value, collectionType);
    } catch (JsonGenerationException e) {
      throw new SwiftJsonMarshallingException(e.toString()
                                              + " source: " + value,
                                              e);
    } catch (JsonMappingException e) {
      throw new SwiftJsonMarshallingException(e.toString()
                                              + " source: " + value,
                                              e);
    }
  }
View Full Code Here

    Writer json = new StringWriter();
    try {
      jsonMapper.writeValue(json, object);
      return json.toString();
    } catch (JsonGenerationException e) {
      throw new SwiftJsonMarshallingException(e.toString(), e);
    } catch (JsonMappingException e) {
      throw new SwiftJsonMarshallingException(e.toString(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.swift.exceptions.SwiftJsonMarshallingException

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.