|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.kfs.sys.businessobject.AccountingLineParserBase
public class AccountingLineParserBase
Base class for parsing serialized AccountingLines for TransactionalDocuments
| Field Summary | |
|---|---|
protected static String[] |
DEFAULT_FORMAT
|
| Constructor Summary | |
|---|---|
AccountingLineParserBase()
|
|
| Method Summary | |
|---|---|
protected String[] |
chooseFormat(Class<? extends AccountingLine> accountingLineClass)
|
String |
getExpectedAccountingLineFormatAsString(Class<? extends AccountingLine> accountingLineClass)
|
protected Class |
getSourceAccountingLineClass(AccountingDocument accountingDocument)
Given a document, determines what class the source lines of that document uses |
String[] |
getSourceAccountingLineFormat()
|
protected Class |
getTargetAccountingLineClass(AccountingDocument accountingDocument)
Given a document, determines what class that document uses for target accounting lines |
String[] |
getTargetAccountingLineFormat()
|
protected List<AccountingLine> |
importAccountingLines(String fileName,
InputStream stream,
AccountingDocument transactionalDocument,
boolean isSource)
Calls the appropriate parseAccountingLine method |
List |
importSourceAccountingLines(String fileName,
InputStream stream,
AccountingDocument document)
generates a list of SourceAccountingLine from the inputStream |
List |
importTargetAccountingLines(String fileName,
InputStream stream,
AccountingDocument document)
generates a list of TargetAccountingLine from the inputStream |
protected Map<String,String> |
parseAccountingLine(Class<? extends AccountingLine> accountingLineClass,
String lineToParse)
Parses the csv line |
SourceAccountingLine |
parseSourceAccountingLine(AccountingDocument transactionalDocument,
String sourceAccountingLineString)
parses a comma deliminated string into an SourceAccountingLine by populating the attributes found in the
getSourceAccountingLineFormat() |
TargetAccountingLine |
parseTargetAccountingLine(AccountingDocument transactionalDocument,
String targetAccountingLineString)
parses a comma deliminated string into an TargetAccountingLine by populating the attributes found in the
getTargetAccountingLineFormat() |
protected void |
performCustomSourceAccountingLinePopulation(Map<String,String> attributeValueMap,
SourceAccountingLine sourceAccountingLine,
String accountingLineAsString)
Should be voerriden by documents to perform any additional SourceAccountingLine population |
protected void |
performCustomTargetAccountingLinePopulation(Map<String,String> attributeValueMap,
TargetAccountingLine targetAccountingLine,
String accountingLineAsString)
Should be overridden by documents to perform any additional TargetAccountingLine attribute population |
protected AccountingLine |
populateAccountingLine(AccountingDocument transactionalDocument,
Class<? extends AccountingLine> accountingLineClass,
String accountingLineAsString,
Map<String,String> attributeValueMap,
Integer sequenceNumber)
Populates a source/target line with values |
protected void |
putCommonAttributesInMap(Map<String,String> attributeValueMap,
AccountingDocument document,
Integer sequenceNumber)
Places fields common to both source/target accounting lines in the attribute map |
String[] |
removeChartFromFormatIfNeeded(String[] format)
If accounts can cross charts, returns the given format; otherwise returns the format with ChartOfAccountsCode field removed. |
protected String |
retrieveAttributeLabel(Class clazz,
String attributeName)
|
protected void |
validateImportedAccountingLine(AccountingLine line,
String accountingLineAsString)
performs any additional accounting line validation |
| 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_FORMAT
| Constructor Detail |
|---|
public AccountingLineParserBase()
| Method Detail |
|---|
public String[] getSourceAccountingLineFormat()
getSourceAccountingLineFormat in interface AccountingLineParserSourceAccountingLine attribute formatorg.kuali.rice.kns.bo.AccountingLineParser#getSourceAccountingLineFormat()public String[] getTargetAccountingLineFormat()
getTargetAccountingLineFormat in interface AccountingLineParserTargetAccountingLine attribute formatorg.kuali.rice.kns.bo.AccountingLineParser#getTargetAccountingLineFormat()public String[] removeChartFromFormatIfNeeded(String[] format)
public String getExpectedAccountingLineFormatAsString(Class<? extends AccountingLine> accountingLineClass)
getExpectedAccountingLineFormatAsString in interface AccountingLineParserString[] attribute format with each attribute seperated by a comma.org.kuali.rice.kns.bo.AccountingLineParser#getExpectedAccountingLineFormatAsString(java.lang.Class)
public SourceAccountingLine parseSourceAccountingLine(AccountingDocument transactionalDocument,
String sourceAccountingLineString)
AccountingLineParserSourceAccountingLine by populating the attributes found in the
getSourceAccountingLineFormat()
parseSourceAccountingLine in interface AccountingLineParserorg.kuali.rice.kns.bo.AccountingLineParser#parseSourceAccountingLine(org.kuali.rice.kns.document.TransactionalDocument,
java.lang.String)protected Class getSourceAccountingLineClass(AccountingDocument accountingDocument)
accountingDocument - the document to find the class of the source lines for
public TargetAccountingLine parseTargetAccountingLine(AccountingDocument transactionalDocument,
String targetAccountingLineString)
AccountingLineParserTargetAccountingLine by populating the attributes found in the
getTargetAccountingLineFormat()
parseTargetAccountingLine in interface AccountingLineParserorg.kuali.rice.kns.bo.AccountingLineParser#parseTargetAccountingLine(org.kuali.rice.kns.document.TransactionalDocument,
java.lang.String)protected Class getTargetAccountingLineClass(AccountingDocument accountingDocument)
accountingDocument - the document to determine the target accounting line class for
protected AccountingLine populateAccountingLine(AccountingDocument transactionalDocument,
Class<? extends AccountingLine> accountingLineClass,
String accountingLineAsString,
Map<String,String> attributeValueMap,
Integer sequenceNumber)
transactionalDocument - accountingLineClass - accountingLineAsString - attributeValueMap - sequenceNumber -
protected void putCommonAttributesInMap(Map<String,String> attributeValueMap,
AccountingDocument document,
Integer sequenceNumber)
attributeValueMap - document - sequenceNumber -
protected Map<String,String> parseAccountingLine(Class<? extends AccountingLine> accountingLineClass,
String lineToParse)
accountingLineClass - lineToParse -
protected void performCustomSourceAccountingLinePopulation(Map<String,String> attributeValueMap,
SourceAccountingLine sourceAccountingLine,
String accountingLineAsString)
SourceAccountingLine population
attributeValueMap - sourceAccountingLine - accountingLineAsString -
protected void performCustomTargetAccountingLinePopulation(Map<String,String> attributeValueMap,
TargetAccountingLine targetAccountingLine,
String accountingLineAsString)
TargetAccountingLine attribute population
attributeValueMap - targetAccountingLine - accountingLineAsString -
protected List<AccountingLine> importAccountingLines(String fileName,
InputStream stream,
AccountingDocument transactionalDocument,
boolean isSource)
stream - transactionalDocument - isSource -
public final List importSourceAccountingLines(String fileName,
InputStream stream,
AccountingDocument document)
AccountingLineParserSourceAccountingLine from the inputStream
importSourceAccountingLines in interface AccountingLineParserSourceAccountingLinesorg.kuali.rice.kns.bo.AccountingLineParser#importSourceAccountingLines(java.io.InputStream,
org.kuali.rice.kns.document.TransactionalDocument)
public final List importTargetAccountingLines(String fileName,
InputStream stream,
AccountingDocument document)
AccountingLineParserTargetAccountingLine from the inputStream
importTargetAccountingLines in interface AccountingLineParserSourceAccountingLinesorg.kuali.rice.kns.bo.AccountingLineParser#importTargetAccountingLines(java.io.InputStream,
org.kuali.rice.kns.document.TransactionalDocument)
protected void validateImportedAccountingLine(AccountingLine line,
String accountingLineAsString)
throws AccountingLineParserException
line - accountingLineAsString -
AccountingLineParserException
protected String retrieveAttributeLabel(Class clazz,
String attributeName)
protected String[] chooseFormat(Class<? extends AccountingLine> accountingLineClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||