if (topicNSToAdd != null){ for (String[] currentNs : topicNSToAdd) { topExprItem.addTopicNamespace(currentNs[0], new URI(currentNs[1]));
/** * A way to create a {@link com.ebmwebsourcing.wsstar.notification.base.TopicExpressionType} * "Jaxb model type" object from a {@link TopicExpressionType} "api type" one * * @param apiTypeObj */ public static com.ebmwebsourcing.wsstar.jaxb.notification.base.TopicExpressionType toJaxbModel(TopicExpressionType apiTypeObj) { com.ebmwebsourcing.wsstar.jaxb.notification.base.TopicExpressionType jaxbTypeObj = null; if (apiTypeObj instanceof TopicExpressionTypeImpl){ jaxbTypeObj = ((TopicExpressionTypeImpl)apiTypeObj).getJaxbTypeObj(); } else { jaxbTypeObj = WsnbJAXBContext.WSNB_JAXB_FACTORY.createTopicExpressionType(); jaxbTypeObj.setDialect(apiTypeObj.getDialect().toString()); jaxbTypeObj.getContent().add(apiTypeObj.getContent()); List<QName> topicNamespaces = apiTypeObj.getTopicNamespaces(); for (QName qName : topicNamespaces) { jaxbTypeObj.getOtherAttributes().put(new QName(CUSTOM_XMLNS_PREFIX+qName.getLocalPart()),qName.getNamespaceURI()); } } return jaxbTypeObj; }
topicNSToAdd.put(Integer.valueOf(topicExpressions.indexOf(topicExprItem)),topicExprItem.getTopicNamespaces()); if (currentQNames != null){ for (QName qnItem : currentQNames) { topicExpressionItem.addTopicNamespace(qnItem.getLocalPart(), new URI (qnItem.getNamespaceURI()));
currentConreteTopExpr = notifMsgItem.getTopic(); if (currentConreteTopExpr != null){ topicNSToAdd.put(Integer.valueOf(notifMessages.indexOf(notifMsgItem)),currentConreteTopExpr.getTopicNamespaces());
topicNSToAdd.addAll(topic.getTopicNamespaces()); topic.addTopicNamespace(qnItem.getLocalPart(), new URI(qnItem.getNamespaceURI()));
List<QName> additianalTopicNS = value.getTopicNamespaces();
topExprList = filter.getTopicExpressions(); for (TopicExpressionType topExprItem : topExprList) { topicNSToAdd.add(topExprItem.getTopicNamespaces()); topExpItem.addTopicNamespace(qnItem.getLocalPart(), new URI(qnItem.getNamespaceURI()));
result.getTopic().addTopicNamespace(currentNs[0], new URI(currentNs[1]));
topExprList = filter.getTopicExpressions(); for (TopicExpressionType topExprItem : topExprList) { topicNSToAdd.add(topExprItem.getTopicNamespaces()); topExpItem.addTopicNamespace(qnItem.getLocalPart(), new URI(qnItem.getNamespaceURI()));
@Override public final TopicExpressionType readTopicExpressionType(Document document) throws WsnbException { TopicExpressionType result = null; try { Unmarshaller unmarshaller = this.wsnbJaxbContext.createWSNotificationUnmarshaller(); // Save additional namespaces present on Topic nodes List<String[]> additionalTopicNS = new ArrayList<String[]>(); Element topicExpressionAsElt = document.getDocumentElement(); if (topicExpressionAsElt!= null) { additionalTopicNS.addAll(this.getAdditionalNamespacesFromDom(topicExpressionAsElt)); } final JAXBElement<com.ebmwebsourcing.wsstar.jaxb.notification.base.TopicExpressionType> schemaBinding = unmarshaller.unmarshal(new DOMSource(document),com.ebmwebsourcing.wsstar.jaxb.notification.base.TopicExpressionType.class); result = new TopicExpressionTypeImpl(schemaBinding.getValue()); // Trick : add previously saved namespaces to the created JaxB model // (will be used on the write process) for (String[] currentNs : additionalTopicNS) { result.addTopicNamespace(currentNs[0], new URI(currentNs[1])); } } catch (JAXBException e) { throw new WsnbException(e); } catch (URISyntaxException e) { throw new WsnbException(e); } return result; }
topicNSToAdd.add(topExprItem.getTopicNamespaces()); topExpItem.addTopicNamespace(qnItem.getLocalPart(), new URI(qnItem.getNamespaceURI()));
for (TopicExpressionType topicExpressionItem : topicExpressions) { for (String[] currentNs : additionalTopicNSs.get(topicExpressions.indexOf(topicExpressionItem))) { topicExpressionItem.addTopicNamespace(currentNs[0], new URI(currentNs[1]));
List<QName> topicNSToAdd = null; if (concrTopExp != null){ topicNSToAdd = concrTopExp.getTopicNamespaces(); concrTopExp.addTopicNamespace(qnItem.getLocalPart(), new URI(qnItem.getNamespaceURI()));
if (concreteTopic != null){ for (String[] currentNs : additionalTopicNS) { concreteTopic.addTopicNamespace(currentNs[0], new URI(currentNs[1]));
for (TopicExpressionType topicExpressionItem : topicExpressions) { for (String[] currentNs : additionalTopicNSs.get(topicExpressions.indexOf(topicExpressionItem))) { topicExpressionItem.addTopicNamespace(currentNs[0], new URI(currentNs[1]));
if (topicNSToAdd != null){ for (String[] currentNs : topicNSToAdd) { notifMsgItem.getTopic().addTopicNamespace(currentNs[0], new URI(currentNs[1]));
for (TopicExpressionType topicExpressionItem : topicExpressions) { for (String[] currentNs : additionalTopicNSs.get(topicExpressions.indexOf(topicExpressionItem))) { topicExpressionItem.addTopicNamespace(currentNs[0], new URI(currentNs[1]));