org.kuali.kfs.vnd.service.impl
Class TaxNumberServiceImpl

java.lang.Object
  extended by org.kuali.kfs.vnd.service.impl.TaxNumberServiceImpl
All Implemented Interfaces:
TaxNumberService

public class TaxNumberServiceImpl
extends Object
implements TaxNumberService


Field Summary
static List<String> feinNumberFormats
           
static List<String> notAllowedTaxNumbers
           
 org.kuali.rice.kns.service.ParameterService parameterService
           
static List<String> taxNumberFormats
           
 
Constructor Summary
TaxNumberServiceImpl()
           
 
Method Summary
 String formatToDefaultFormat(String taxNbr)
           
 boolean isAllowedTaxNumber(String taxNbr)
          Someday we'll have to use the rules table instead of using constants.
 boolean isStringAllNumbers(String field)
          A predicate to determine if a String field is all numbers
 boolean isStringEmpty(String field)
          A predicate to determine if a String field is null or empty
 boolean isValidTaxNumber(String taxNbr, String taxType)
          A predicate to determine the validity of tax numbers We're using regular expressions stored in the business rules table to validate whether the tax number is in the correct format.
 String[] parseFEINFormats()
          Splits the set of tax fein number formats which are returned from the rule service as a semicolon-delimeted String into a String array.
 String[] parseNotAllowedTaxNumbers()
          Splits the set of not allowed tax number formats which are returned from the rule service as a semicolon-delimeted String into a String array.
 String[] parseSSNFormats()
          Splits the set of tax number formats which are returned from the rule service as a semicolon-delimeted String into a String array.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameterService

public org.kuali.rice.kns.service.ParameterService parameterService

taxNumberFormats

public static List<String> taxNumberFormats

feinNumberFormats

public static List<String> feinNumberFormats

notAllowedTaxNumbers

public static List<String> notAllowedTaxNumbers
Constructor Detail

TaxNumberServiceImpl

public TaxNumberServiceImpl()
Method Detail

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)

formatToDefaultFormat

public String formatToDefaultFormat(String taxNbr)
                             throws org.kuali.rice.kns.web.format.FormatException
Specified by:
formatToDefaultFormat in interface TaxNumberService
Throws:
org.kuali.rice.kns.web.format.FormatException

isStringAllNumbers

public boolean isStringAllNumbers(String field)
A predicate to determine if a String field is all numbers

Specified by:
isStringAllNumbers in interface TaxNumberService
Parameters:
field - A String tax number
Returns:
True if String is numeric

isStringEmpty

public boolean isStringEmpty(String field)
A predicate to determine if a String field is null or empty

Specified by:
isStringEmpty in interface TaxNumberService
Parameters:
field - A String tax number
Returns:
True if String is null or empty

isValidTaxNumber

public boolean isValidTaxNumber(String taxNbr,
                                String taxType)
A predicate to determine the validity of tax numbers We're using regular expressions stored in the business rules table to validate whether the tax number is in the correct format. The regular expressions are : (please update this javadoc comment when the regular expressions change) 1. For SSN : (?!000)(?!666)(\d{3})([ \-]?)(?!00)(\d{2})([\-]?)(?!0000)(\d{4}) 2. For FEIN : (?!00)(\d{3})([ \-]?)(\d{2})([\-]?)(?!0000)(\d{4})

Specified by:
isValidTaxNumber in interface TaxNumberService
Parameters:
taxNbr - A tax number String (SSN or FEIN)
taxType - determines SSN or FEIN tax number type
Returns:
True if the tax number is known to be in a valid format

isAllowedTaxNumber

public boolean isAllowedTaxNumber(String taxNbr)
Someday we'll have to use the rules table instead of using constants. This method will return true if the tax number is an allowed tax number and return false if it's not allowed.

Specified by:
isAllowedTaxNumber in interface TaxNumberService
Parameters:
taxNbr - The tax number to be processed.
Returns:
boolean true if the tax number is allowed and false otherwise.

parseSSNFormats

public String[] parseSSNFormats()
Splits the set of tax number formats which are returned from the rule service as a semicolon-delimeted String into a String array.

Specified by:
parseSSNFormats in interface TaxNumberService
Returns:
A String array of the tax number format regular expressions.

parseFEINFormats

public String[] parseFEINFormats()
Splits the set of tax fein number formats which are returned from the rule service as a semicolon-delimeted String into a String array.

Specified by:
parseFEINFormats in interface TaxNumberService
Returns:
A String array of the tax fein number format regular expressions.

parseNotAllowedTaxNumbers

public String[] parseNotAllowedTaxNumbers()
Splits the set of not allowed tax number formats which are returned from the rule service as a semicolon-delimeted String into a String array.

Specified by:
parseNotAllowedTaxNumbers in interface TaxNumberService
Returns:
A String array of the not allowed tax number format regular expressions.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.