throw new WsnbException("Bad number of notification messages!"); Element element = notify.getNotificationMessage().get(0).getMessage().getAny(); if (element != null) { args[0] = element.getOwnerDocument();
/** * A way to create a {@link com.ebmwebsourcing.wsstar.notification.base.GetCurrentMessageResponse} * "Jaxb model type" object from a {@link GetCurrentMessageResponse} "api type" one * * @param apiTypeObj */ public static com.ebmwebsourcing.wsstar.jaxb.notification.base.GetCurrentMessageResponse toJaxbModel(GetCurrentMessageResponse apiTypeObj) { com.ebmwebsourcing.wsstar.jaxb.notification.base.GetCurrentMessageResponse jaxbTypeObj = null; if (apiTypeObj instanceof GetCurrentMessageResponseImpl){ jaxbTypeObj = ((GetCurrentMessageResponseImpl)apiTypeObj).getJaxbTypeObj(); } else { jaxbTypeObj = WsnbJAXBContext.WSNB_JAXB_FACTORY.createGetCurrentMessageResponse(); // ~~~~ Set Notification(s) ~~~~ List<NotificationMessageHolderType.Message> notifications = apiTypeObj.getNotifications(); List<Object> jaxbAny = jaxbTypeObj.getAny(); if (notifications != null){ for (NotificationMessageHolderType.Message notificationItem : notifications) { jaxbAny.add(notificationItem.getAny()); } } } return jaxbTypeObj; } }
/** * A way to create a {@link com.ebmwebsourcing.wsstar.jaxb.notification.base.NotificationMessageHolderType.Message} * "Jaxb model type" object from a {@link NotificationMessageHolderType.Message} "api type" one * @param apiTypeObj * @return */ public static com.ebmwebsourcing.wsstar.jaxb.notification.base.NotificationMessageHolderType.Message toJaxbModel( Message apiTypeObj) { com.ebmwebsourcing.wsstar.jaxb.notification.base.NotificationMessageHolderType.Message jaxbTypeObj = null; if (apiTypeObj instanceof NotificationMessageHolderTypeImpl.MessageImpl) { jaxbTypeObj = ((NotificationMessageHolderTypeImpl.MessageImpl)apiTypeObj).getJaxbTypeObj(); } else { jaxbTypeObj = WsnbJAXBContext.WSNB_JAXB_FACTORY.createNotificationMessageHolderTypeMessage(); jaxbTypeObj.setAny(apiTypeObj.getAny()); } return jaxbTypeObj; }
@Override public final void addCurrentMessage(Message notification) { this.jaxbTypeObj.getAny().add(notification.getAny()); }
/** * Default constructor */ protected GetCurrentMessageResponseImpl(NotificationMessageHolderType.Message notification) { this.jaxbTypeObj = WsnbJAXBContext.WSNB_JAXB_FACTORY.createGetCurrentMessageResponse(); this.jaxbTypeObj.getAny().add(notification.getAny()); }