@ SuppressWarnings ( "unchecked" ) protected List < Task > loadSubtasks ( EntityConfig config , Reagent subtasksPhrase , boolean warnIfMissing ) { final List < Task > subtasks = new LinkedList < Task > ( ) ; final List < Element > taskElements = ( List < Element > ) config . getValue ( subtasksPhrase ) ; final Grammar grammar = config . getGrammar ( ) ; for ( final Element taskElement : taskElements ) { final Task task = grammar . newTask ( taskElement , this ) ; subtasks . add ( task ) ; } // There's likely an error in the Cernunnos XML // if we don't have any subtasks, issue a warning... if ( warnIfMissing && subtasks . size ( ) == 0 && log . isWarnEnabled ( ) ) { log . warn ( "POSSIBLE PROGRAMMING ERROR: Class '" + getClass ( ) . getName ( ) + "' has an empty collection of " + subtasksPhrase . getName ( ) + "\n\t\tSource: " + config . getSource ( ) + "\n\t\tEntity Name: " + config . getEntryName ( ) ) ; } return subtasks ; }
Abstracts the loading of subtasks for a Reagent into a single menthod