public StageBean createStageBean ( boolean forExecution , StageLibraryTask library , StageConfiguration stageConf , boolean validateAnnotations , boolean errorStage , boolean pipelineLifecycleStage , Map < String , Object > constants , InterceptorCreatorContextBuilder interceptorContextBuilder , List < Issue > errors ) { IssueCreator issueCreator = IssueCreator . getStage ( stageConf . getInstanceName ( ) ) ; StageBean bean = null ; StageDefinition stageDef = library . getStage ( stageConf . getLibrary ( ) , stageConf . getStageName ( ) , forExecution ) ; if ( stageDef != null ) { // Pipeline lifecycle events validation must match, whether it's also marked as error stage does not matter if ( validateAnnotations ) { if ( pipelineLifecycleStage ) { if ( ! stageDef . isPipelineLifecycleStage ( ) ) { errors . add ( issueCreator . create ( CreationError . CREATION_018 , stageDef . getLibraryLabel ( ) , stageDef . getLabel ( ) , stageConf . getStageVersion ( ) ) ) ; } // For non pipeline lifecycle stages, the error stage annotation must match } else if ( stageDef . isErrorStage ( ) != errorStage ) { if ( stageDef . isErrorStage ( ) ) { errors . add ( issueCreator . create ( CreationError . CREATION_007 , stageDef . getLibraryLabel ( ) , stageDef . getLabel ( ) , stageConf . getStageVersion ( ) ) ) ; } else { errors . add ( issueCreator . create ( CreationError . CREATION_008 , stageDef . getLibraryLabel ( ) , stageDef . getLabel ( ) , stageConf . getStageVersion ( ) ) ) ; } } } bean = createStage ( library , stageDef , library , stageConf , serviceClass -> library . getServiceDefinition ( serviceClass , true ) , interceptorContextBuilder , constants , errors ) ; } else { errors . add ( issueCreator . create ( CreationError . CREATION_006 , stageConf . getLibrary ( ) , stageConf . getStageName ( ) , stageConf . getStageVersion ( ) ) ) ; } return bean ; }
Create new instance of StageBean .