/** * @param localName * @param ns * @param value */ public void addAttribute(String localName, OMNamespace ns, String value) { if (attributes == null) { attributes = new ArrayList<OMAttribute>(); } attributes.add(OMAbstractFactory.getOMFactory().createOMAttribute(localName, ns, value)); }
protected void setMustUnderstand(OMElement headerElement, OMNamespace omNamespace) { OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMAttribute mustUnderstandAttribute = omFactory.createOMAttribute(SOAP12Constants.ATTR_MUSTUNDERSTAND, omNamespace, "true"); headerElement.addAttribute(mustUnderstandAttribute); }
private OMElement mk_object_ref_list(List uuids) { OMElement object_ref_list = MetadataSupport.om_factory.createOMElement("ObjectRefList", null); for (Iterator it=uuids.iterator(); it.hasNext(); ) { String uuid = (String) it.next(); OMAttribute att = MetadataSupport.om_factory.createOMAttribute("id", null, uuid); OMElement object_ref = MetadataSupport.om_factory.createOMElement("ObjectRef", null); object_ref.addAttribute(att); object_ref_list.addChild(object_ref); } return object_ref_list; }
private void addSourceAttribute(String source, OMElement element) throws EvaluatorException { if (source != null) { element.addAttribute(fac.createOMAttribute(EvaluatorConstants.SOURCE, nullNS, source)); } else { String msg = "If type is not URL a source value should be specified for " + "the evaluator"; log.error(msg); throw new EvaluatorException(msg); } }
private static OMElement getHeader(OMFactory factory) { OMElement header = factory.createOMElement("header", null); OMElement msgType = factory.createOMElement("field", null); msgType.addAttribute(factory.createOMAttribute("id", null, "35")); factory.createOMText(msgType, "D"); header.addChild(msgType); OMElement sendingTime = factory.createOMElement("field", null); sendingTime.addAttribute(factory.createOMAttribute("id", null, "52")); factory.createOMText(sendingTime, new Date().toString()); header.addChild(sendingTime); return header; }
private void serializeParams(OMElement invokeElem, InvokeMediator mediator) { Map<String, Value> paramsMap = mediator.getpName2ExpressionMap(); for (Map.Entry<String,Value> entry : paramsMap.entrySet()) { if (!"".equals(entry.getKey())) { OMElement paramEl = fac.createOMElement(InvokeMediatorFactory.WITH_PARAM_Q.getLocalPart(), synNS); paramEl.addAttribute(fac.createOMAttribute("name", nullNS, entry.getKey())); //serialize value attribute new ValueSerializer().serializeValue(entry.getValue(), "value", paramEl); invokeElem.addChild(paramEl); } } }
private static OMElement getHeader(OMFactory factory) { OMElement header = factory.createOMElement("header", null); OMElement msgType = factory.createOMElement("field", null); msgType.addAttribute(factory.createOMAttribute("id", null, "35")); factory.createOMText(msgType, "D"); header.addChild(msgType); OMElement sendingTime = factory.createOMElement("field", null); sendingTime.addAttribute(factory.createOMAttribute("id", null, "52")); factory.createOMText(sendingTime, new Date().toString()); header.addChild(sendingTime); return header; }
private void addClaimType(OMElement parent, String uri) { OMElement element = null; element = parent.getOMFactory().createOMElement( new QName("http://schemas.xmlsoap.org/ws/2005/05/identity", "ClaimType", "wsid"), parent); element.addAttribute(parent.getOMFactory().createOMAttribute("Uri", null, uri)); }
private void addClaimType(OMElement parent, String uri) { OMElement element = null; element = parent.getOMFactory().createOMElement( new QName("http://schemas.xmlsoap.org/ws/2005/05/identity", "ClaimType", "wsid"), parent); element.addAttribute(parent.getOMFactory().createOMAttribute("Uri", null, uri)); }
private void serializeCreateBeanCase(OMElement mediatorElem, BeanMediator mediator) { if (mediator.getClazz() != null) { mediatorElem.addAttribute(fac.createOMAttribute( BeanConstants.CLASS, nullNS, mediator.getClazz().getName())); } else { handleException(); } if (!mediator.isReplace()) { mediatorElem.addAttribute(fac.createOMAttribute( BeanConstants.REPLACE, nullNS, Boolean.toString(false))); } }
private void serializeCreateBeanCase(OMElement mediatorElem, BeanMediator mediator) { if (mediator.getClazz() != null) { mediatorElem.addAttribute(fac.createOMAttribute( BeanConstants.CLASS, nullNS, mediator.getClazz().getName())); } else { handleException(); } if (!mediator.isReplace()) { mediatorElem.addAttribute(fac.createOMAttribute( BeanConstants.REPLACE, nullNS, Boolean.toString(false))); } }
@Override public void appendText(OMElement parentElement, String textData) throws Java2XMLMapperException { if (textData == null) { OMNamespace xsi = factory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi"); OMAttribute nil = factory.createOMAttribute("nil", xsi, "true"); parentElement.addAttribute(nil); } else { factory.createOMText(parentElement, textData); } }
private void attachXSINil(OMElement element) { OMNamespace xsiNS = element.getOMFactory().createOMNamespace(XSI_TYPE_QNAME.getNamespaceURI(), XSI_TYPE_QNAME.getPrefix()); element.declareNamespace(xsiNS); OMAttribute attr = element.getOMFactory().createOMAttribute("nil", xsiNS, "true"); element.addAttribute(attr); }
public OMElement serializeSpecificMediator(Mediator m) { if (!(m instanceof TransactionMediator)) { handleException("Unsupported mediator passed in for serialization : " + m.getType()); } TransactionMediator mediator = (TransactionMediator) m; OMElement transaction = fac.createOMElement("transaction", synNS); transaction.addAttribute(fac.createOMAttribute("action", nullNS, mediator.getAction())); saveTracingState(transaction, mediator); return transaction; }
private void serializePropertyName(OMElement mediatorElem, BeanMediator mediator) { if (mediator.getPropertyName() != null) { mediatorElem.addAttribute(fac.createOMAttribute( BeanConstants.PROPERTY, nullNS, mediator.getPropertyName())); } else { handleException(); } }
@Override protected OMElement createElement(QName element, String text, TransformationContext context) { OMElement omElement = AxiomHelper.createOMElement(factory, element); if (text == null) { OMNamespace xsi = factory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi"); OMAttribute nil = factory.createOMAttribute("nil", xsi, "true"); omElement.addAttribute(nil); } else { factory.createOMText(omElement, text); } return omElement; }
public OMElement serializeSpecificMediator(Mediator m) { if (!(m instanceof DBReportMediator)) { handleException("Unsupported mediator passed in for serialization : " + m.getType()); } DBReportMediator mediator = (DBReportMediator) m; OMElement dbReport = fac.createOMElement("dbreport", synNS); if (mediator.isUseTransaction()) { dbReport.addAttribute(fac.createOMAttribute("useTransaction", nullNS, "true")); } saveTracingState(dbReport, mediator); serializeDBInformation(mediator, dbReport); return dbReport; }
public static OMElement serializeXPath(SynapseXPath xpath, String expression, OMElement elem, String attribName) { OMNamespace nullNS = elem.getOMFactory() .createOMNamespace(XMLConfigConstants.NULL_NAMESPACE, ""); if (xpath != null && expression != null) { elem.addAttribute(elem.getOMFactory().createOMAttribute( attribName, nullNS, expression)); serializeNamespaces(elem, xpath); } else { handleException("Couldn't find the xpath in the SynapseXPath"); } return elem; }
public static OMElement serializeXPath(SynapseXPath xpath, OMElement elem, String attribName) { OMNamespace nullNS = elem.getOMFactory() .createOMNamespace(XMLConfigConstants.NULL_NAMESPACE, ""); if (xpath != null) { elem.addAttribute(elem.getOMFactory().createOMAttribute( attribName, nullNS, xpath.toString())); serializeNamespaces(elem, xpath); } else { handleException("Couldn't find the xpath in the SynapseXPath"); } return elem; }
public static OMElement serializeXPath(SynapseXPath xpath, OMElement elem, String attribName) { OMNamespace nullNS = elem.getOMFactory() .createOMNamespace(XMLConfigConstants.NULL_NAMESPACE, ""); if (xpath != null) { elem.addAttribute(elem.getOMFactory().createOMAttribute( attribName, nullNS, xpath.toString())); serializeNamespaces(elem, xpath); } else { handleException("Couldn't find the xpath in the SynapseXPath"); } return elem; }