}
}
private DSLSentence toDSLSentence( List<String> dslPatterns,
String dslLine ) {
DSLSentence dslSentence = new DSLSentence();
for ( String dslPattern : dslPatterns ) {
String regex = dslPattern.replaceAll( "\\{\\s*[\\:\\.\\w]+\\s*\\}", "(.*)" );
Matcher m = Pattern.compile( regex ).matcher( dslLine );
if ( m.matches() ) {
dslSentence.setDefinition( dslPattern );
for ( int i = 0; i < m.groupCount(); i++ ) {
dslSentence.getValues().get( i ).setValue( m.group( i + 1 ) );
}
return dslSentence;
}
}
dslSentence.setDefinition( dslLine );
return dslSentence;
}