integration-impl/src/main/java/se/idsec/signservice/integration/dss/DssUtils.java
public static <T> T toOpenSAML(@Nonnull final Object jaxbObject, @Nonnull final Class<T> destination)
      throws SignServiceProtocolException {
    try {
      Element element = JAXBMarshaller.marshall(jaxbObject).getDocumentElement();
      Unmarshaller unmarshaller = XMLObjectSupport.getUnmarshaller(element);
      XMLObject object = unmarshaller.unmarshall(element);
      return destination.cast(object);
    }
    catch (JAXBException | UnmarshallingException e) {
      throw new SignServiceProtocolException(String.format("Failed to decode %s - %s", destination.getSimpleName(), e.getMessage()), e);
    }
  }
/**
   * Transforms a JAXB object to its corresponding OpenSAML object.
   * 
   * @param jaxbObject
   *          JAXB object
   * @param destination
   *          the OpenSAML class
   * @return OpenSAML object
   * @throws SignServiceProtocolException
   *           for unmarshalling errors
   */
Transforms a JAXB object to its corresponding OpenSAML object.

@param jaxbObject
JAXB object
@param destination
the OpenSAML class
@return OpenSAML object
@throws SignServiceProtocolException
for unmarshalling errors
Transforms a JAXB object to its corresponding OpenSAML object . @param jaxbObject JAXB object @param destination the OpenSAML class @return OpenSAML object @throws SignServiceProtocolException for unmarshalling errors
public static <T> T toOpenSAML(@Nonnull final Object jaxbObject, @Nonnull final Class<T> destination)
      throws SignServiceProtocolException {
    try {
      Element element = JAXBMarshaller.marshall(jaxbObject).getDocumentElement();
      Unmarshaller unmarshaller = XMLObjectSupport.getUnmarshaller(element);
      XMLObject object = unmarshaller.unmarshall(element);
      return destination.cast(object);
    }
    catch (JAXBException | UnmarshallingException e) {
      throw new SignServiceProtocolException(String.format("Failed to decode %s - %s", destination.getSimpleName(), e.getMessage()), e);
    }
  }
public static < T > T toOpenSAML ( @ Nonnull final Object jaxbObject , @ Nonnull final Class < T > destination ) throws SignServiceProtocolException { try { Element element = JAXBMarshaller . marshall ( jaxbObject ) . getDocumentElement ( ) ; Unmarshaller unmarshaller = XMLObjectSupport . getUnmarshaller ( element ) ; XMLObject object = unmarshaller . unmarshall ( element ) ; return destination . cast ( object ) ; } catch ( JAXBException | UnmarshallingException e ) { throw new SignServiceProtocolException ( String . format ( "Failed to decode %s - %s" , destination . getSimpleName ( ) , e . getMessage ( ) ) , e ) ; } }
Transforms a JAXB object to its corresponding OpenSAML object.
Transforms a JAXB object to its corresponding OpenSAML object .