本文整理了Java中org.apache.axiom.om.OMFactory.createOMText()
方法的一些代码示例,展示了OMFactory.createOMText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OMFactory.createOMText()
方法的具体详情如下:
包路径:org.apache.axiom.om.OMFactory
类名称:OMFactory
方法名:createOMText
暂无
代码示例来源:origin: org.apache.axis2/axis2-kernel
public void setDocumentation(String documentation) {
if (!"".equals(documentation)) {
this.documentation = omFactory.createOMText(documentation);
}
}
代码示例来源:origin: org.apache.axis2/axis2-kernel
private OMElement createElement()
{
OMFactory factory = OMAbstractFactory.getOMFactory();
OMText textNode = factory.createOMText(genericContent, true);
OMElement wrapperElement = factory.createOMElement(unknownContentQName);
wrapperElement.addChild(textNode);
return wrapperElement;
}
}
代码示例来源:origin: org.paxml/paxml-core
/**
* Create text node.
*
* @param text
* the text
* @return the text node
*/
public static OMText createTextNode(String text) {
return AxiomUtils.getOMFactory().createOMText(text);
}
代码示例来源:origin: org.apache.axis2/axis2-transport-base
public OMElement processDocument(String content,
String contentType,
MessageContext msgContext) throws AxisFault {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMElement wrapper = factory.createOMElement(getWrapperQName(msgContext), null);
factory.createOMText(wrapper, content);
return wrapper;
}
代码示例来源:origin: org.ballerinalang/ballerina-core
/**
* Create a comment type BXML.
*
* @param content Text content
* @return BXML Text type BXML
*/
public static BXML<?> createXMLText(String content) {
// Remove carriage return on windows environments to eliminate additional 
 being added
content = content.replace("\r\n", "\n");
OMText omText = OM_FACTORY.createOMText(content);
return new BXMLItem(omText);
}
代码示例来源:origin: org.springframework.ws/org.springframework.ws
public void characters(char ch[], int start, int length) throws SAXException {
String data = new String(ch, start, length);
OMContainer parent = getParent();
factory.createOMText(parent, data, charactersType);
}
代码示例来源:origin: org.paxml/PaxmlCore
/**
* Create text node.
* @param text the text
* @return the text node
*/
public static OMText createTextNode(String text) {
return AxiomUtils.getOMFactory().createOMText(text);
}
/**
代码示例来源:origin: org.wso2.ei/org.wso2.ei.samples
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;
}
代码示例来源:origin: org.apache.synapse/synapse-samples
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;
}
代码示例来源:origin: org.apache.abdera/abdera-parser
public <T extends Element> T setText(DataHandler handler) {
_removeAllChildren();
addChild(factory.createOMText(handler, true));
return (T)this;
}
代码示例来源:origin: org.apache.axis2/axis2-saaj
public SOAPElement addTextNode(String text) throws SOAPException {
Node firstChild = target.getFirstChild();
if (firstChild instanceof org.w3c.dom.Text) {
((org.w3c.dom.Text)firstChild).setData(text);
} else {
// Else this is a header
((OMNode)firstChild).insertSiblingBefore(this.omTarget.getOMFactory().createOMText(text));
}
return this;
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core
private void setCategoryExpr(String XField, OMElement categorySeriesElement, String xExpressionText)
throws JaxenException {
Iterator iter = categorySeriesElement.getChildrenWithName(new QName(xExpressionText));
OMElement aCatExpr = (OMElement) iter.next();
aCatExpr.setText("");
OMFactory factory = document.getOMFactory();
OMText cdataField = factory.createOMText(aCatExpr, "$F{" + XField + "}", OMText.CDATA_SECTION_NODE);
aCatExpr.addChild(cdataField);
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core
private void setValueExpr(String YField, OMElement categorySeriesElement, String yExpressionText)
throws JaxenException {
Iterator iter = categorySeriesElement.getChildrenWithName(new QName(yExpressionText));
OMElement aValueExpr = (OMElement) iter.next();
aValueExpr.setText("");
OMFactory factory = document.getOMFactory();
OMText cdataField = factory.createOMText(aValueExpr, "$F{" + YField + "}", OMText.CDATA_SECTION_NODE);
aValueExpr.addChild(cdataField);
}
代码示例来源:origin: org.apache.synapse/synapse-core
public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) {
OMFactory fac = envelope.getOMFactory();
OMElement binaryElt = envelope.getOMFactory()
.createOMElement(BINARYELT);
OMText text = fac.createOMText(dh, true);
binaryElt.addChild(text);
setXMLPayload(envelope, binaryElt);
}
代码示例来源:origin: org.apache.synapse/synapse-core
public static void setTextPayload(SOAPEnvelope envelope, String text) {
OMFactory fac = envelope.getOMFactory();
OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT);
OMText textNode = fac.createOMText(text);
textElt.addChild(textNode);
setXMLPayload(envelope, textElt);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding-axiom
@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);
}
}
代码示例来源:origin: com.github.veithen.visualwas/connector
@Override
public QName setValue(OMElement element, Object value, InvocationContextImpl context) {
element.addChild(element.getOMFactory().createOMText(new ObjectDataHandler(value, context), false));
return new QName("urn:AdminService", context.getSerializer().getRemoteClassName(type));
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding-axiom
@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;
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core
private void updateSubReportParamName(OMElement subReportElement, String paramName) throws JaxenException {
AXIOMXPath xpathExpression = new AXIOMXPath("//a:subreportParameter//a:subreportParameterExpression");
xpathExpression.addNamespace("a", "http://jasperreports.sourceforge.net/jasperreports");
List nodeList = xpathExpression.selectNodes(subReportElement);
OMElement repExp = (OMElement) nodeList.get(0);
repExp.setText("");
OMFactory factory = document.getOMFactory();
OMText cdataField = factory.createOMText(repExp, "$P{" + paramName + "}", OMText.CDATA_SECTION_NODE);
repExp.addChild(cdataField);
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core
private void updateSubReportExpression(OMElement subReportElement, String subReportName) throws JaxenException {
AXIOMXPath xpathExpression = new AXIOMXPath("//a:subreportExpression");
xpathExpression.addNamespace("a", "http://jasperreports.sourceforge.net/jasperreports");
List nodeList = xpathExpression.selectNodes(subReportElement);
OMElement element = (OMElement) nodeList.get(0);
element.setText("");
OMFactory factory = document.getOMFactory();
OMText cdataField = factory.createOMText(element,"$P{" + subReportName + "}", OMText.CDATA_SECTION_NODE);
element.addChild(cdataField);
}
内容来源于网络,如有侵权,请联系作者删除!