use of org.ballerinalang.toml.model.fields.DependencyField in project ballerina by ballerina-lang.
the class ManifestBuildListener method createDependencyObject.
/**
* Create dependency object and set the name.
*
* @param packageName pkg name of the dependency
*/
private void createDependencyObject(String packageName) {
dependency = new Dependency();
DependencyField dependencyField = DependencyField.NAME;
if (dependencyField != null) {
dependencyField.setValueTo(dependency, packageName);
}
}
use of org.ballerinalang.toml.model.fields.DependencyField in project ballerina by ballerina-lang.
the class ManifestBuildListener method populateDependencyField.
/**
* Populate dependency fields by iterating over the context object.
*
* @param ctx Inline table values
*/
private void populateDependencyField(TomlParser.InlineTableKeyvalsContext ctx) {
for (TomlParser.InlineTableKeyvalsNonEmptyContext valueContext : ctx.inlineTableKeyvalsNonEmpty()) {
String name = valueContext.key().getText();
DependencyField dependencyField = DependencyField.valueOfLowerCase(name);
if (dependencyField != null) {
String value = valueContext.val().getText();
if (valueContext.val().string() != null) {
value = valueContext.val().string().basicString().basicStringValue().getText();
}
dependencyField.setValueTo(dependency, value);
}
}
}
Aggregations