private List < BannerComponentNode > parseBannerComponents ( BannerText bannerText ) { int length = 0 ; List < BannerComponentNode > bannerComponentNodes = new ArrayList <> ( ) ; for ( BannerComponents components : bannerText . components ( ) ) { BannerComponentNode node = null ; for ( NodeCreator nodeCreator : nodeCreators ) { if ( nodeCreator . isNodeType ( components ) ) { node = nodeCreator . setupNode ( components , bannerComponentNodes . size ( ) , length , bannerText . modifier ( ) ) ; break ; } } if ( node != null ) { bannerComponentNodes . add ( node ) ; length += components . text ( ) . length ( ) ; } } return bannerComponentNodes ; }
Parses the banner components and processes them using the nodeCreators in the order they were originally passed