use of org.ballerinalang.util.codegen.StructInfo in project ballerina by ballerina-lang.
the class BLangVMErrors method createIllegalStateException.
public static BStruct createIllegalStateException(Context context, String msg) {
PackageInfo errorPackageInfo = context.getProgramFile().getPackageInfo(PACKAGE_RUNTIME);
StructInfo errorStructInfo = errorPackageInfo.getStructInfo(STRUCT_ILLEGAL_STATE_EXCEPTION);
return createError(context, true, errorStructInfo, msg);
}
use of org.ballerinalang.util.codegen.StructInfo in project ballerina by ballerina-lang.
the class BLangVMErrors method createNullRefException.
public static BStruct createNullRefException(CallableUnitInfo callableUnitInfo) {
ProgramFile progFile = callableUnitInfo.getPackageInfo().getProgramFile();
PackageInfo errorPackageInfo = progFile.getPackageInfo(PACKAGE_RUNTIME);
StructInfo errorStructInfo = errorPackageInfo.getStructInfo(STRUCT_NULL_REF_EXCEPTION);
return generateError(callableUnitInfo, true, errorStructInfo);
}
use of org.ballerinalang.util.codegen.StructInfo in project ballerina by ballerina-lang.
the class BLangVMErrors method createNullRefException.
public static BStruct createNullRefException(WorkerExecutionContext context) {
PackageInfo errorPackageInfo = context.programFile.getPackageInfo(PACKAGE_RUNTIME);
StructInfo errorStructInfo = errorPackageInfo.getStructInfo(STRUCT_NULL_REF_EXCEPTION);
return generateError(context, true, errorStructInfo);
}
use of org.ballerinalang.util.codegen.StructInfo in project ballerina by ballerina-lang.
the class BLangConnectorSPIUtil method createBStruct.
public static BStruct createBStruct(ProgramFile programFile, String pkgPath, String structName, Object... values) {
PackageInfo packageInfo = programFile.getPackageInfo(pkgPath);
if (packageInfo == null) {
throw new BallerinaConnectorException("package - " + pkgPath + " does not exist");
}
StructInfo structInfo = packageInfo.getStructInfo(structName);
if (structInfo == null) {
throw new BallerinaConnectorException("struct - " + structName + " does not exist");
}
return BLangVMStructs.createBStruct(structInfo, values);
}
use of org.ballerinalang.util.codegen.StructInfo in project ballerina by ballerina-lang.
the class BCompileUtil method createAndGetStruct.
public static BStruct createAndGetStruct(ProgramFile programFile, String packagePath, String structName) {
PackageInfo structPackageInfo = programFile.getPackageInfo(packagePath);
StructInfo structInfo = structPackageInfo.getStructInfo(structName);
BStructType structType = structInfo.getType();
return new BStruct(structType);
}
Aggregations