org.kuali.kfs.module.purap.util
Interface ItemParser

All Known Implementing Classes:
ItemParserBase

public interface ItemParser

Defines an abstraction for parsing serialized PurApItem lines.


Method Summary
 String getExpectedItemFormatAsString(Class<? extends PurApItem> itemClass)
          Returns the expected format of the items to be imported.
 String[] getItemFormat()
          Returns the defined format of item lines in the item import file.
 List<PurApItem> importItems(org.apache.struts.upload.FormFile itemFile, Class<? extends PurApItem> itemClass, String documentNumber)
          Parses the items from the specified import file line by line, and generates items of the specified type from the parsed data.
 PurApItem parseItem(String itemLine, Class<? extends PurApItem> itemClass, String documentNumber)
          Parses the specified item line into an instance of the specified PurApItem subclass.
 

Method Detail

getItemFormat

String[] getItemFormat()
Returns the defined format of item lines in the item import file.

Returns:
the item line format as an array of item property names

getExpectedItemFormatAsString

String getExpectedItemFormatAsString(Class<? extends PurApItem> itemClass)
Returns the expected format of the items to be imported.

Parameters:
itemClass - the class of the items to be imported
Returns:
the concatenation of the actual property names of the items to be imported

parseItem

PurApItem parseItem(String itemLine,
                    Class<? extends PurApItem> itemClass,
                    String documentNumber)
Parses the specified item line into an instance of the specified PurApItem subclass.

Parameters:
itemLine - the item line string to be parsed
itemClass - the subclass of the item to be generated
documentNumber - the number of the docment that contains the item to be generated
Returns:
the generated item

importItems

List<PurApItem> importItems(org.apache.struts.upload.FormFile itemFile,
                            Class<? extends PurApItem> itemClass,
                            String documentNumber)
Parses the items from the specified import file line by line, and generates items of the specified type from the parsed data.

Parameters:
itemFile - the input file from which items are parsed
itemClass - a subclass of PurApItem, of which new items shall be generated
documentNumber - the number of the docment that contains the items to be imported
Returns:
a list of items of a subclass of PurApItem.


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