org.kuali.kfs.vnd
Class VendorUtils

java.lang.Object
  extended by org.kuali.kfs.vnd.VendorUtils

public class VendorUtils
extends Object

Utility class with helper methods for Vendor processing


Field Summary
static char FIELD_SEPERATOR
           
static char LEFT_COLLECTION_SEPERATOR
           
static char RIGHT_COLLECTION_SEPERATOR
           
 
Constructor Summary
VendorUtils()
           
 
Method Summary
static String assembleWithPosition(String full, String[] collections, int[] positions)
          Builds up a string and a position like so abc, 1 becomes abc[1] it is used for fields that require operations on collections.
static String assembleWithPosition(String full, String collection, int position)
          A helper to call assembleWithPosition(String full, String[] collections, int[] positions) when only one collection
static String buildMessageText(String messageKey, String... parameters)
          Composes the text for the note related to parent change to be added to the old parent vendor.
static Integer getVendorDetailId(String vendorNumber)
          Returns the detailId portion from a composite vendor number.
static Integer getVendorHeaderId(String vendorNumber)
          Returns the headerId portion from a composite vendor number.
static boolean validVendorNumberFormat(String vendorNumber)
          Accepts a vendorNumber string, and evaluates it to make sure it is of the correct format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_COLLECTION_SEPERATOR

public static final char LEFT_COLLECTION_SEPERATOR
See Also:
Constant Field Values

RIGHT_COLLECTION_SEPERATOR

public static final char RIGHT_COLLECTION_SEPERATOR
See Also:
Constant Field Values

FIELD_SEPERATOR

public static final char FIELD_SEPERATOR
See Also:
Constant Field Values
Constructor Detail

VendorUtils

public VendorUtils()
Method Detail

assembleWithPosition

public static String assembleWithPosition(String full,
                                          String[] collections,
                                          int[] positions)
Builds up a string and a position like so abc, 1 becomes abc[1] it is used for fields that require operations on collections.

Parameters:
full -
collections -
pos -
Returns:
Newly formatted string

assembleWithPosition

public static String assembleWithPosition(String full,
                                          String collection,
                                          int position)
A helper to call assembleWithPosition(String full, String[] collections, int[] positions) when only one collection

Parameters:
full -
collection -
position -
Returns:
Newly formatted string

getVendorHeaderId

public static Integer getVendorHeaderId(String vendorNumber)
Returns the headerId portion from a composite vendor number.

Parameters:
vendorNumber - - composite vendor number (detail and header)
Returns:
returns the headerId number

getVendorDetailId

public static Integer getVendorDetailId(String vendorNumber)
Returns the detailId portion from a composite vendor number.

Parameters:
vendorNumber - - composite vendor number (detail and header)
Returns:
returns the detailId number

validVendorNumberFormat

public static boolean validVendorNumberFormat(String vendorNumber)
Accepts a vendorNumber string, and evaluates it to make sure it is of the correct format. This method does not test whether the given vendor number exists in the database, rather it just tests that the format is correct.

Parameters:
vendorNumber - - String representing the vendor number
Returns:
- returns an empty string on success, or an error message on a failure

buildMessageText

public static String buildMessageText(String messageKey,
                                      String... parameters)
Composes the text for the note related to parent change to be added to the old parent vendor.

Parameters:
messageKey -
parameters -
Returns:


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