private ProcPattern createPattern ( Pattern pattern ) { if ( pattern . isEmpty ( ) ) { throw new IllegalStateException ( "Pattern elements list can't be empty." ) ; } List < ProcPatternElement > elements = new ArrayList < ProcPatternElement > ( ) ; for ( PatternElement element : pattern . getElements ( ) ) { elements . add ( patternElementFactory . create ( element ) ) ; } return new ProcPattern ( elements ) ; }
Create a pattern for text parsing