APISonar


org.wso2.ballerinalang.compiler.util.TypeTags.XML

> org > wso2 > ballerinalang > compiler > util > TypeTags > XML
org APIs wso2 APIs ballerinalang APIs compiler APIs util APIs TypeTags APIs XML APIs

Example 1
private static void validateDataBindingParam(BLangFunction resource, List<BLangSimpleVariable> paramDetails,
                                                 DiagnosticLog dlog) {
        BType paramType = paramDetails.get(1).type;
        int paramTypeTag = paramType.tag;
        if (paramTypeTag != TypeTags.STRING && paramTypeTag != TypeTags.JSON &&
                paramTypeTag != TypeTags.XML && paramTypeTag != TypeTags.RECORD &&
                paramTypeTag != TypeTags.FLOAT && paramTypeTag != TypeTags.INT
                && validateArrayType(paramType)) {
            dlog.logDiagnostic(Diagnostic.Kind.ERROR, resource.pos, INVALID_RESOURCE_SIGNATURE_FOR
                    + resource.getName().getValue() + RESOURCE_IN_SERVICE +
                    ": The second parameter can only be an int, float, string, json, xml, byte[] or a record type");
        }
    }
Example 2
private BType getTypeOfIndexBasedAccessExpr(BType bType) {
        switch (bType.tag) {
            case TypeTags.ARRAY:
            case TypeTags.JSON:
            case TypeTags.MAP:
            case TypeTags.OBJECT:
            case TypeTags.RECORD:
            case TypeTags.TUPLE:
            case TypeTags.XML:
                return bType;
            default:
                // If its any other type return the any|error.
                return BUnionType.create(null, symTable.anyType, symTable.errorType);
        }
    }
Example 3
public void visit(BLangXMLTextLiteral xmlTextLiteral) {
        if (xmlTextLiteral.type == null) {
            xmlTextLiteral.regIndex = calcAndGetExprRegIndex(xmlTextLiteral.regIndex, TypeTags.XML);
        } else {
            xmlTextLiteral.regIndex = calcAndGetExprRegIndex(xmlTextLiteral);
        }
        genNode(xmlTextLiteral.concatExpr, env);
        emit(InstructionCodes.NEWXMLTEXT, xmlTextLiteral.regIndex, xmlTextLiteral.concatExpr.regIndex);
    }