|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.module.endow.util.LineParserBase
public class LineParserBase
Field Summary | |
---|---|
protected static String[] |
DEFAULT_LINE_FORMAT
The default format defines the expected line property names and their order in the import file. |
Constructor Summary | |
---|---|
LineParserBase()
|
Method Summary | |
---|---|
protected void |
checkLineClass(Class<? extends EndowmentTransactionLine> lineClass)
Checks whether the specified Line class is a subclass of EndowmentTransactionLine; throws exceptions if not. |
protected void |
checkLineFile(org.apache.struts.upload.FormFile lineFile)
Checks whether the specified line import file is not null and of a valid format; throws exceptions if conditions not satisfied. |
protected EndowmentTransactionLine |
genLineWithRetrievedAttributes(Map<String,String> lineMap,
Class<? extends EndowmentTransactionLine> lineClass)
Generates an line instance and populates it with the specified attribute map. |
protected String |
getAttributeLabel(Class clazz,
String attributeName)
Retrieves the attribute label for the specified attribute. |
String[] |
getLineFormat()
|
List<EndowmentTransactionLine> |
importLines(org.apache.struts.upload.FormFile lineFile,
Class<? extends EndowmentTransactionLine> lineClass,
String documentNumber)
Parses the items from the specified import file line by line, and generates items of the specified type from the parsed data. |
EndowmentTransactionLine |
parseLine(String transactionLine,
Class<? extends EndowmentTransactionLine> lineClass,
String documentNumber)
|
protected Map<String,String> |
retrieveLineAttributes(String line,
Class<? extends EndowmentTransactionLine> lineClass)
Parses a line of transactions data from a csv file and retrieves the attributes as key-value string pairs into a map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String[] DEFAULT_LINE_FORMAT
Constructor Detail |
---|
public LineParserBase()
Method Detail |
---|
public String[] getLineFormat()
ItemParser.getItemFormat()
protected String getAttributeLabel(Class clazz, String attributeName)
clazz
- the class in which the specified attribute is definedattributeName
- the name of the specified attribute
protected void checkLineClass(Class<? extends EndowmentTransactionLine> lineClass)
lineClass
- the specified line classprotected void checkLineFile(org.apache.struts.upload.FormFile lineFile)
lineClass
- the specified line import fileprotected Map<String,String> retrieveLineAttributes(String line, Class<? extends EndowmentTransactionLine> lineClass)
line
- a string read from a line in the line import file
protected EndowmentTransactionLine genLineWithRetrievedAttributes(Map<String,String> lineMap, Class<? extends EndowmentTransactionLine> lineClass)
lineMap
- the specified attribute map from which attributes are populatedlineClass
- the class of which the new line instance shall be created
public List<EndowmentTransactionLine> importLines(org.apache.struts.upload.FormFile lineFile, Class<? extends EndowmentTransactionLine> lineClass, String documentNumber)
LineParser
importLines
in interface LineParser
documentNumber
- the number of the docment that contains the items to be imported
org.kuali.kfs.module.purap.util.ItemParser#parseItem(org.apache.struts.upload.FormFile,java.lang.Class,java.lang.String)
public EndowmentTransactionLine parseLine(String transactionLine, Class<? extends EndowmentTransactionLine> lineClass, String documentNumber)
ItemParser.parseItem(java.lang.String,java.lang.Class,java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |