use of org.ballerinalang.util.codegen.LocalVariableInfo in project ballerina by ballerina-lang.
the class ResourceImpl method getParamDetails.
@Override
public List<ParamDetail> getParamDetails() {
LocalVariableAttributeInfo attributeInfo = (LocalVariableAttributeInfo) resourceInfo.getAttributeInfo(AttributeInfo.Kind.LOCAL_VARIABLES_ATTRIBUTE);
List<ParamDetail> paramDetails = new ArrayList<>();
for (LocalVariableInfo variableInfo : attributeInfo.getLocalVariableInfoEntries()) {
paramDetails.add(new ParamDetail(variableInfo.getVariableType(), variableInfo.getVariableName()));
}
return paramDetails;
}
use of org.ballerinalang.util.codegen.LocalVariableInfo in project ballerina by ballerina-lang.
the class BLangVMStructs method createBConnector.
/**
* Create BConnector with given values.
*
* @param connectorInfo {@link ConnectorInfo} of the {@link BConnector}
* @param values field values of the connector ( including args ).
* @return BStruct instance.
*/
public static BConnector createBConnector(ConnectorInfo connectorInfo, Object... values) {
BConnector bConnector = new BConnector(connectorInfo.getType());
final LocalVariableAttributeInfo localVar = (LocalVariableAttributeInfo) connectorInfo.getAttributeInfo(AttributeInfo.Kind.LOCAL_VARIABLES_ATTRIBUTE);
int i = 0;
int[] indexes = new int[] { -1, -1, -1, -1, -1, -1 };
for (LocalVariableInfo variableInfo : localVar.getLocalVariables()) {
if (values.length < i + 1) {
break;
}
final BType varType = variableInfo.getVariableType();
setValue(bConnector, indexes, varType.getTag(), values[i]);
}
return bConnector;
}
Aggregations