Skip to content

Commit

Permalink
Merge branch '3471_all_inclusive_builder_modifier' into 'dev'
Browse files Browse the repository at this point in the history
generate default access modifier of builder classes as all access

See merge request monticore/monticore!857
  • Loading branch information
SE-FDr committed Jul 26, 2023
2 parents c2ce456 + 4d070a3 commit 56824b5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import de.monticore.codegen.cd2java._ast.builder.buildermethods.BuilderMutatorMethodDecorator;
import de.monticore.codegen.cd2java._symboltable.SymbolTableService;
import de.monticore.generating.templateengine.GlobalExtensionManagement;
import de.monticore.generating.templateengine.StringHookPoint;
import de.monticore.generating.templateengine.TemplateHookPoint;
import de.monticore.types.mcbasictypes._ast.ASTMCType;
import de.monticore.types.mccollectiontypes._ast.ASTMCOptionalType;
Expand All @@ -22,6 +23,7 @@
import java.util.Optional;
import java.util.stream.Collectors;

import static de.monticore.cd.codegen.CD2JavaTemplates.VALUE;
import static de.monticore.cd.facade.CDModifier.PROTECTED;
import static de.monticore.cd.facade.CDModifier.PUBLIC;
import static de.monticore.cd.codegen.CD2JavaTemplates.EMPTY_BODY;
Expand Down Expand Up @@ -139,7 +141,9 @@ protected List<ASTCDAttribute> createSymbolAttributes(ASTCDClass symbolClass) {
symbolTableService.getASTPackage() + "." + AST_PREFIX + symbolClass.getName());
attrs.add(this.getCDAttributeFacade().createAttribute(PROTECTED.build(), optionalTypeOfASTNode, AST_NODE_VAR));

attrs.add(this.getCDAttributeFacade().createAttribute(PROTECTED.build(), ACCESS_MODIFIER, "accessModifier"));
ASTCDAttribute accessModifier = this.getCDAttributeFacade().createAttribute(PROTECTED.build(), ACCESS_MODIFIER, "accessModifier");
this.replaceTemplate(VALUE, accessModifier, new StringHookPoint("= " + ACCESS_MODIFIER_ALL_INCLUSION));
attrs.add(accessModifier);

attrs.add(this.getCDAttributeFacade().createAttribute(PROTECTED.build(),
symbolTableService.getScopeInterfaceFullName(), ENCLOSING_SCOPE_VAR));
Expand Down

0 comments on commit 56824b5

Please sign in to comment.