Skip to content

Commit

Permalink
Updates the auto-generated getArea() method to Override the ServiceInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
CesarCoelho committed Oct 22, 2024
1 parent b74e31f commit 5ee5606
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import esa.mo.tools.stubgen.specification.TypeRef;
import esa.mo.tools.stubgen.specification.TypeUtils;
import esa.mo.tools.stubgen.writers.ClassWriter;
import esa.mo.tools.stubgen.writers.LanguageWriter;
import esa.mo.tools.stubgen.writers.MethodWriter;
import esa.mo.xsd.AnyTypeReference;
import esa.mo.xsd.AreaType;
Expand Down Expand Up @@ -118,7 +117,7 @@ public void createServiceInfoClass(File serviceFolder, AreaType area,
file.addClassVariable(true, true, StdStrings.PUBLIC, _opNumberVar, false, op.getNumber().toString());
file.addClassVariable(true, true, StdStrings.PUBLIC, opNumberVar, false, "(_" + operationInstanceVar + "_OP_NUMBER)");

List<String> opArgs = this.generateOperationArgs(file, op);
List<String> opArgs = this.generateOperationArgs(op);
String operationName = operationInstanceVar + "_OP";
CompositeField opInstVar = generator.createCompositeElementsDetails(file, false, operationName,
TypeUtils.createTypeReference(StdStrings.MAL, null, generator.getOperationInstanceType(op), false),
Expand Down Expand Up @@ -259,10 +258,7 @@ public void createServiceInfoClass(File serviceFolder, AreaType area,
CompositeField opType = generator.createCompositeElementsDetails(file, false, "return",
TypeUtils.createTypeReference(null, null, "org.ccsds.moims.mo.mal.MALArea", false),
false, true, null);
MethodWriter method = file.addMethodOpenStatement(false, false, StdStrings.PUBLIC,
false, true, opType, "getArea", null, null,
"Returns the corresponding MALArea from this service.",
"Returns the corresponding MALArea from this service.", null);
MethodWriter method = file.addMethodOpenStatementOverride(opType, "getArea", null, null);

method.addLine("return " + namespace, true);
method.addMethodCloseStatement();
Expand Down Expand Up @@ -316,7 +312,7 @@ private void createComObjectHelperDetails(ClassWriter file, List<String> comObje
+ hasRelated + ", " + relatedShortForm + ", " + hasSource + ", " + sourceShortForm + ", " + isEvent + ")");
}

private List<String> generateOperationArgs(LanguageWriter file, OperationSummary op) {
private List<String> generateOperationArgs(OperationSummary op) {
String initNewLine = "\n ";
// Operation Number
List<String> opArgs = new LinkedList<>();
Expand Down

0 comments on commit 5ee5606

Please sign in to comment.