use of org.apache.axiom.om.impl.llom.OMSourcedElementImpl in project wso2-axis2-transports by wso2.
the class PlainTextBuilder method processDocument.
public OMElement processDocument(DataSource dataSource, String contentType, MessageContext msgContext) throws AxisFault {
OMFactory factory = OMAbstractFactory.getOMFactory();
Charset cs = Charset.forName(BuilderUtil.getCharSetEncoding(contentType));
QName wrapperQName = getWrapperQName(msgContext);
return new OMSourcedElementImpl(wrapperQName, factory, new WrappedTextNodeOMDataSourceFromDataSource(wrapperQName, dataSource, cs));
}
use of org.apache.axiom.om.impl.llom.OMSourcedElementImpl in project wso2-axis2-transports by wso2.
the class PlainTextBuilder method processDocument.
public OMElement processDocument(Reader reader, String contentType, MessageContext msgContext) throws AxisFault {
OMFactory factory = OMAbstractFactory.getOMFactory();
QName wrapperQName = getWrapperQName(msgContext);
return new OMSourcedElementImpl(wrapperQName, factory, new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
}
use of org.apache.axiom.om.impl.llom.OMSourcedElementImpl in project wso2-axis2-transports by wso2.
the class PlainTextBuilder method processDocument.
public OMElement processDocument(InputStream inputStream, String contentType, MessageContext msgContext) throws AxisFault {
OMFactory factory = OMAbstractFactory.getOMFactory();
String charSetEnc = BuilderUtil.getCharSetEncoding(contentType);
QName wrapperQName = getWrapperQName(msgContext);
Reader reader;
try {
reader = new InputStreamReader(inputStream, charSetEnc);
} catch (UnsupportedEncodingException ex) {
throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
}
return new OMSourcedElementImpl(wrapperQName, factory, new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
}
Aggregations