public void createActionsWith ( ActionBuilder codeBuilder , Collection < IMethod > methods , XtendTypeDeclaration context ) throws JavaModelException , IllegalArgumentException { if ( methods != null ) { for ( final IMethod operation : methods ) { if ( ! isGeneratedOperation ( operation ) ) { final ISarlActionBuilder action = codeBuilder . addAction ( operation . getElementName ( ) ) ; action . setReturnType ( Signature . toString ( operation . getReturnType ( ) ) ) ; final IFormalParameterBuilder [ ] sarlParams = createFormalParametersWith ( name -> action . addParameter ( name ) , operation ) ; if ( context != null ) { final JvmType type = this . typeReferences . findDeclaredType ( operation . getDeclaringType ( ) . getFullyQualifiedName ( ) , context ) ; final JvmOperation superOperation = getJvmOperation ( operation , type ) ; // Create the block final IBlockExpressionBuilder block = action . getExpression ( ) ; if ( ( type . eClass ( ) != TypesPackage . Literals . JVM_GENERIC_TYPE || ! ( ( JvmGenericType ) type ) . isInterface ( ) ) && superOperation != null && ! superOperation . isAbstract ( ) ) { // Create the super-call expression final IExpressionBuilder superCall = block . addExpression ( ) ; final XMemberFeatureCall call = XbaseFactory . eINSTANCE . createXMemberFeatureCall ( ) ; superCall . setXExpression ( call ) ; superCall . setDocumentation ( block . getAutoGeneratedActionString ( ) ) ; call . setFeature ( superOperation ) ; call . setMemberCallTarget ( superCall . createReferenceToSuper ( ) ) ; final List < XExpression > arguments = call . getMemberCallArguments ( ) ; for ( final IFormalParameterBuilder currentParam : sarlParams ) { final XFeatureCall argumentSource = XbaseFactory . eINSTANCE . createXFeatureCall ( ) ; arguments . add ( argumentSource ) ; currentParam . setReferenceInto ( argumentSource ) ; } } else { final JvmTypeReference ret = superOperation != null ? superOperation . getReturnType ( ) : null ; block . setDefaultAutoGeneratedContent ( ret == null ? null : ret . getIdentifier ( ) ) ; } } } } } }
Create the operations into the SARL feature container .