Package com.cloudesire.tisana4j.exceptions

Examples of com.cloudesire.tisana4j.exceptions.ParseException


        List<T> objList = mapper.reader(mapper.getTypeFactory().constructCollectionType(List.class, clazz))
            .readValue(stream);
        return objList;
      } catch (JsonProcessingException  e)
      {
        throw new ParseException(e);
      }
    } catch ( IOException e)
    {
      throw new RuntimeRestException(e);
    }
View Full Code Here


      {
        T obj = mapper.reader(clazz).readValue(stream);
        return obj;
      } catch (JsonProcessingException e)
      {
        throw new ParseException(e);
      }
    } catch (IllegalStateException | IOException e1)
    {
      throw new RuntimeRestException(e1);
    }
View Full Code Here

      {
        T obj = (T) unmarshallerB.unmarshal(stream);
        return obj;
      } catch (JAXBException e)
      {
        throw new ParseException(e);
      }
    } catch (IllegalStateException | IOException | JAXBException e1)
    {
      throw new RuntimeRestException(e1);
    }
View Full Code Here

        StringEntity entity = new StringEntity(payload);
        log.debug("Payload:\n " + payload);
        request.setEntity(entity);
      } catch ( JsonProcessingException | UnsupportedEncodingException e)
      {
        throw new ParseException(e);
      }
    }
    else
    {
      request.addHeader("Content-type", "application/xml");
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JAXBContext context;
      try
      {
        context = JAXBContext.newInstance(obj.getClass());
      Marshaller m = context.createMarshaller();
      m.marshal(obj, baos);
      String payload = baos.toString();
      StringEntity entity = new StringEntity(payload);
      log.debug("Payload:\n " + payload);
      request.setEntity(entity);
      } catch (JAXBException | UnsupportedEncodingException e)
      {
        throw new ParseException(e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.cloudesire.tisana4j.exceptions.ParseException

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.