Skip to content

Commit

Permalink
Merge pull request #1 from NipunaMarcus/ls-connector-backed
Browse files Browse the repository at this point in the history
Add display name for connectors
  • Loading branch information
suhothayan authored Jun 19, 2020
2 parents 800f750 + a294a46 commit 0e8df2f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,24 @@ public class BallerinaConnectorInfo {
private String module;
private String name;
private String version;
private String displayName;
private String logoBase64Encoded;

public BallerinaConnectorInfo(String org, String module, String name, String version) {
public BallerinaConnectorInfo(String org, String module, String name, String version, String displayName) {
this.org = org;
this.module = module;
this.name = name;
this.version = version;
this.displayName = displayName;
}

public BallerinaConnectorInfo(String org, String module, String name, String version,
public BallerinaConnectorInfo(String org, String module, String name, String version, String displayName,
String logoBase64Encoded) {
this.org = org;
this.module = module;
this.name = name;
this.version = version;
this.displayName = displayName;
this.logoBase64Encoded = logoBase64Encoded;
}

Expand All @@ -62,6 +65,10 @@ public String getVersion() {
return version;
}

public String getDisplayName() {
return displayName;
}

public String getLogoBase64Encoded() {
return logoBase64Encoded;
}
Expand All @@ -73,6 +80,7 @@ public String toString() {
", module='" + module + '\'' +
", name='" + name + '\'' +
", version='" + version + '\'' +
", displayName='" + displayName + '\'' +
", logoBase64Encoded='" + logoBase64Encoded + '\'' +
'}';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ public class BallerinaConnectorRequest {
private String module;
private String version = "";
private String name;
private String displayName;

public BallerinaConnectorRequest(String org, String module, String version, String name) {
public BallerinaConnectorRequest(String org, String module, String version, String name, String displayName) {
this.org = org;
this.module = module;
this.version = version;
this.name = name;
this.displayName = displayName;
}

public String getOrg() {
Expand All @@ -53,6 +55,10 @@ public String getName() {
return name;
}

public String getDisplayName() {
return displayName;
}

@Override
public String toString() {
return "BallerinaConnectorRequest{" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ public class BallerinaConnectorResponse {
private final String module;
private final String version;
private final String name;
private final String displayName;
private JsonElement ast;

public BallerinaConnectorResponse(String org, String module, String version, String name, JsonElement ast) {
public BallerinaConnectorResponse(String org, String module, String version, String name, String displayName,
JsonElement ast) {
this.org = org;
this.module = module;
this.version = version;
this.name = name;
this.displayName = displayName;
this.ast = ast;
}

Expand All @@ -57,6 +60,10 @@ public String getName() {
return name;
}

public String getDisplayName() {
return displayName;
}

public JsonElement getAst() {
return ast;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public CompletableFuture<BallerinaConnectorResponse> connector(BallerinaConnecto
}
}
BallerinaConnectorResponse response = new BallerinaConnectorResponse(request.getOrg(), request.getModule(),
request.getVersion(), request.getName(), ast);
request.getVersion(), request.getName(), request.getDisplayName() , ast);
return CompletableFuture.supplyAsync(() -> response);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ public void visit(BLangConstant constant) {
@Override
public void visit(BLangSimpleVariable varNode) {
addVariableNode(varNode);
varNode.getTypeNode().accept(this);
if (varNode.getTypeNode() != null) {
varNode.getTypeNode().accept(this);
}

if (varNode.getInitialExpression() != null) {
varNode.getInitialExpression().accept(this);
}
Expand Down

0 comments on commit 0e8df2f

Please sign in to comment.