private static String patternMatching ( String ptnName , String input ) { String suffix = "" ; if ( ptnNumber == null ) patternCompile ( ) ; Matcher matcher ; if ( ptnName . equals ( "number" ) ) { matcher = ptnNumber . matcher ( input ) ; if ( matcher . matches ( ) ) suffix = ":number" ; } else if ( ptnName . equals ( "short_date" ) ) { matcher = ptnShortDate . matcher ( input ) ; if ( matcher . matches ( ) ) suffix = ":short-date" ; } else if ( ptnName . equals ( "long_date" ) ) { matcher = ptnLongDate . matcher ( input ) ; if ( matcher . matches ( ) ) suffix = ":long-date" ; } else if ( ptnName . equals ( "percentage" ) ) { matcher = ptnPercentage . matcher ( input ) ; if ( matcher . matches ( ) ) suffix = ":percentage" ; } else if ( ptnName . equals ( "currency" ) ) { matcher = ptnCurrency . matcher ( input ) ; if ( matcher . matches ( ) ) suffix = ":currency" ; else { matcher = ptnViCurrency . matcher ( input ) ; if ( matcher . matches ( ) ) { suffix = ":currency" ; } } } return suffix ; }
Pattern matching .