Skip to content

Commit

Permalink
Fix code generation for Events
Browse files Browse the repository at this point in the history
  • Loading branch information
atextor committed Oct 13, 2023
1 parent 27fc2e8 commit cb4a5d6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig;
import org.eclipse.esmf.aspectmodel.java.JavaGenerator;
import org.eclipse.esmf.aspectmodel.java.QualifiedName;

import org.eclipse.esmf.characteristic.Enumeration;
import org.eclipse.esmf.metamodel.Aspect;
import org.eclipse.esmf.metamodel.ComplexType;
import org.eclipse.esmf.metamodel.Event;

/**
* Generates Java Domain classes for an Aspect model and all its contained elements.
Expand All @@ -35,9 +35,12 @@ public AspectModelJavaGenerator( final Aspect aspect, final JavaCodeGenerationCo

@Override
protected Stream<Artifact<QualifiedName, String>> generateArtifacts() {
return Stream.of( applyTemplate( Aspect.class, new StructureElementJavaArtifactGenerator<>(), config ),
return Stream.of(
applyTemplate( Aspect.class, new StructureElementJavaArtifactGenerator<>(), config ),
applyTemplate( ComplexType.class, new StructureElementJavaArtifactGenerator<>(
elements( ComplexType.class ).filter( element -> element.getExtends().isPresent() ).collect( Collectors.toSet() ) ), config ),
elements( ComplexType.class ).filter( element ->
element.getExtends().isPresent() ).collect( Collectors.toSet() ) ), config ),
applyTemplate( Event.class, new StructureElementJavaArtifactGenerator<>(), config ),
applyTemplate( Enumeration.class, new EnumerationJavaArtifactGenerator<>(), config ) )
.flatMap( Function.identity() );
}
Expand Down

0 comments on commit cb4a5d6

Please sign in to comment.