private ProcCode createCode ( Code defCode ) { if ( ! defCode . hasPatterns ( ) ) { throw new IllegalStateException ( "Field pattern can't be null." ) ; } if ( defCode . getTemplate ( ) == null ) { throw new IllegalStateException ( "Field template can't be null." ) ; } ProcCode code = codes . get ( defCode ) ; if ( code == null ) { List < Pattern > confPatterns = defCode . getPatterns ( ) ; List < ProcPattern > procPatterns = new ArrayList < ProcPattern > ( confPatterns . size ( ) ) ; for ( Pattern confPattern : confPatterns ) { procPatterns . add ( createPattern ( confPattern ) ) ; } code = new ProcCode ( procPatterns , createTemplate ( defCode . getTemplate ( ) ) , defCode . getName ( ) , defCode . getPriority ( ) , defCode . isTransparent ( ) ) ; codes . put ( defCode , code ) ; } return code ; }
Create code from this definition