public class TaxIdFormatter extends Object
| Constructor and Description |
|---|
TaxIdFormatter() |
| Modifier and Type | Method and Description |
|---|---|
static String |
determineFormat(String countryCode,
String taxId)
Determines tax id format by applying a number of regular expressions to the tax id.
|
static boolean |
hasDigitsOnly(String ref) |
static String |
printTaxId(String srcFormat,
String taxId,
String dstFormat)
Print tax id in given format.
|
static String |
removeBlanks(String cleanUp)
Remove blanks from a string.
|
static String |
toDigitsOnly(String cleanUp)
Remove all non digit characters
|
public static String toDigitsOnly(String cleanUp)
cleanUp - String to be cleaned.public static boolean hasDigitsOnly(String ref)
public static String removeBlanks(String cleanUp)
cleanUp - String to clean up.public static String printTaxId(String srcFormat, String taxId, String dstFormat) throws UnknownTaxIdFormatException, InvalidTaxIdFormatException
srcFormat - The format of the taxId-attribute. If null, the tax id format tries to be determined.
Note, this can be lengthy.taxId - The actual tax id.dstFormat - The destination format.UnknownTaxIdFormatExceptionInvalidTaxIdFormatExceptionpublic static String determineFormat(String countryCode, String taxId)
countryCode - If country code is supplied, only that country's tax id patterns are tried.taxId - The tax id to determine.Copyright © 2021 Notima System Integration AB. All rights reserved.