Search in sources :

Example 1 with BXMLType

use of org.wso2.ballerinalang.compiler.semantics.model.types.BXMLType in project ballerina by ballerina-lang.

the class PackageActionFunctionAndTypesFilter method populateIterableOperations.

private void populateIterableOperations(SymbolInfo variable, List<SymbolInfo> symbolInfoList) {
    BType bType = variable.getScopeEntry().symbol.getType();
    if (bType instanceof BArrayType || bType instanceof BMapType || bType instanceof BJSONType || bType instanceof BXMLType || bType instanceof BTableType || bType instanceof BIntermediateCollectionType) {
        fillForeachIterableOperation(bType, symbolInfoList);
        fillMapIterableOperation(bType, symbolInfoList);
        fillFilterIterableOperation(bType, symbolInfoList);
        fillCountIterableOperation(symbolInfoList);
        if (bType instanceof BArrayType && (((BArrayType) bType).eType.toString().equals("int") || ((BArrayType) bType).eType.toString().equals("float"))) {
            fillMinIterableOperation(symbolInfoList);
            fillMaxIterableOperation(symbolInfoList);
            fillAverageIterableOperation(symbolInfoList);
            fillSumIterableOperation(symbolInfoList);
        }
    // TODO: Add support for Table and Tuple collection
    }
}
Also used : BMapType(org.wso2.ballerinalang.compiler.semantics.model.types.BMapType) BXMLType(org.wso2.ballerinalang.compiler.semantics.model.types.BXMLType) BArrayType(org.wso2.ballerinalang.compiler.semantics.model.types.BArrayType) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) BJSONType(org.wso2.ballerinalang.compiler.semantics.model.types.BJSONType) BIntermediateCollectionType(org.wso2.ballerinalang.compiler.semantics.model.types.BIntermediateCollectionType) BTableType(org.wso2.ballerinalang.compiler.semantics.model.types.BTableType)

Aggregations

BArrayType (org.wso2.ballerinalang.compiler.semantics.model.types.BArrayType)1 BIntermediateCollectionType (org.wso2.ballerinalang.compiler.semantics.model.types.BIntermediateCollectionType)1 BJSONType (org.wso2.ballerinalang.compiler.semantics.model.types.BJSONType)1 BMapType (org.wso2.ballerinalang.compiler.semantics.model.types.BMapType)1 BTableType (org.wso2.ballerinalang.compiler.semantics.model.types.BTableType)1 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)1 BXMLType (org.wso2.ballerinalang.compiler.semantics.model.types.BXMLType)1