private String interpolate ( MarcField marcField , String value ) { if ( value == null ) { return null ; } Matcher m = REP . matcher ( value ) ; if ( m . find ( ) ) { return m . replaceAll ( Integer . toString ( repeatCounter ) ) ; } m = NREP . matcher ( value ) ; if ( m . find ( ) ) { if ( repeatCounter > 99 ) { repeatCounter = 99 ; logger . log ( Level . WARNING , "counter > 99, overflow in %s" , marcField ) ; } return m . replaceAll ( String . format ( "%02d" , repeatCounter ) ) ; } return value ; }
Interpolate variables .