public void createStandardConstructorsWith ( ConstructorBuilder codeBuilder , Collection < IMethod > superClassConstructors , XtendTypeDeclaration context ) throws JavaModelException { if ( superClassConstructors != null ) { for ( final IMethod constructor : superClassConstructors ) { if ( ! isGeneratedOperation ( constructor ) ) { final ISarlConstructorBuilder cons = codeBuilder . addConstructor ( ) ; // Create parameters final IFormalParameterBuilder [ ] sarlParams = createFormalParametersWith ( name -> cons . addParameter ( name ) , constructor ) ; // Create the block final IBlockExpressionBuilder block = cons . getExpression ( ) ; // Create thre super-call expression final IExpressionBuilder superCall = block . addExpression ( ) ; final XFeatureCall call = XbaseFactory . eINSTANCE . createXFeatureCall ( ) ; superCall . setXExpression ( call ) ; // Set the todo comment. superCall . setDocumentation ( block . getAutoGeneratedActionString ( ) ) ; // Create the super-call XExpression call . setFeature ( getJvmConstructor ( constructor , context ) ) ; call . setExplicitOperationCall ( true ) ; final List < XExpression > arguments = call . getFeatureCallArguments ( ) ; for ( final IFormalParameterBuilder currentParam : sarlParams ) { final XFeatureCall argumentSource = XbaseFactory . eINSTANCE . createXFeatureCall ( ) ; arguments . add ( argumentSource ) ; currentParam . setReferenceInto ( argumentSource ) ; } } } } }
Add the given constructors to the Ecore container .