Package org.platformlayer.xml

Examples of org.platformlayer.xml.JaxbHelper.deserialize()


    try {
      Class<T> objectClass = (Class<T>) o.getClass();
      JaxbHelper jaxbHelper = JaxbHelper.get(objectClass);

      String xml = JaxbHelper.toXml(o, false);
      return jaxbHelper.deserialize(new StringReader(xml), objectClass);
    } catch (UnmarshalException e) {
      throw new IllegalStateException("Error while cloning object", e);
    } catch (JAXBException e) {
      throw new IllegalStateException("Error while cloning object", e);
    }
View Full Code Here


    }

    if (format == Format.XML) {
      JaxbHelper jaxb = JaxbHelper.get(c);
      try {
        return jaxb.deserialize(new StringReader(data), c);
      } catch (UnmarshalException e) {
        throw new OpsException("Error deserializing item", e);
      }
    } else {
      throw new UnsupportedOperationException();
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.