Search in sources :

Example 1 with TableOMDataSource

use of org.ballerinalang.model.TableOMDataSource in project ballerina by ballerina-lang.

the class XMLUtils method tableToXML.

/**
 * Converts a {@link BTable} to {@link BXML}.
 *
 * @param table {@link BTable} to convert
 * @param isInTransaction   Within a transaction or not
 * @return converted {@link BXML}
 */
@SuppressWarnings("rawtypes")
public static BXML tableToXML(BTable table, boolean isInTransaction) {
    OMSourcedElementImpl omSourcedElement = new OMSourcedElementImpl();
    omSourcedElement.init(new TableOMDataSource(table, null, null, isInTransaction));
    return new BXMLItem(omSourcedElement);
}
Also used : BXMLItem(org.ballerinalang.model.values.BXMLItem) TableOMDataSource(org.ballerinalang.model.TableOMDataSource) OMSourcedElementImpl(org.apache.axiom.om.impl.llom.OMSourcedElementImpl)

Aggregations

OMSourcedElementImpl (org.apache.axiom.om.impl.llom.OMSourcedElementImpl)1 TableOMDataSource (org.ballerinalang.model.TableOMDataSource)1 BXMLItem (org.ballerinalang.model.values.BXMLItem)1