Search in sources :

Example 36 with WSMarshaller

use of org.openecard.ws.marshal.WSMarshaller in project open-ecard by ecsec.

the class JAXBUtils method deepCopy.

@Nonnull
public static <T> T deepCopy(@Nonnull T in) throws MarshallingTypeException, WSMarshallerException {
    WSMarshaller m = WSMarshallerFactory.createInstance();
    Document d = m.marshal(in);
    Object out = m.unmarshal(d);
    return ((Class<T>) in.getClass()).cast(out);
}
Also used : WSMarshaller(org.openecard.ws.marshal.WSMarshaller) Document(org.w3c.dom.Document) Nonnull(javax.annotation.Nonnull)

Aggregations

WSMarshaller (org.openecard.ws.marshal.WSMarshaller)36 Test (org.testng.annotations.Test)28 Document (org.w3c.dom.Document)21 IOException (java.io.IOException)12 InternationalStringType (oasis.names.tc.dss._1_0.core.schema.InternationalStringType)6 WSMarshallerException (org.openecard.ws.marshal.WSMarshallerException)6 Element (org.w3c.dom.Element)6 BigInteger (java.math.BigInteger)5 Result (oasis.names.tc.dss._1_0.core.schema.Result)5 EstablishChannel (iso.std.iso_iec._24727.tech.schema.EstablishChannel)4 StringReader (java.io.StringReader)4 Connect (iso.std.iso_iec._24727.tech.schema.Connect)3 ConnectionHandleType (iso.std.iso_iec._24727.tech.schema.ConnectionHandleType)3 DIDAuthenticateResponse (iso.std.iso_iec._24727.tech.schema.DIDAuthenticateResponse)3 EstablishChannelResponse (iso.std.iso_iec._24727.tech.schema.EstablishChannelResponse)3 EstablishContext (iso.std.iso_iec._24727.tech.schema.EstablishContext)3 DocumentBuilder (javax.xml.parsers.DocumentBuilder)3 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)3 ChannelHandleType (iso.std.iso_iec._24727.tech.schema.ChannelHandleType)2 ControlIFD (iso.std.iso_iec._24727.tech.schema.ControlIFD)2