001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.module.endow.businessobject; 017 018 import java.io.InputStream; 019 import java.util.List; 020 021 import org.kuali.kfs.module.endow.document.EndowmentAccountingLinesDocument; 022 023 public interface EndowmentAccountingLineParser { 024 025 /** 026 * @return <code>SourceEndowmentAccountingLine</code> attribute format 027 */ 028 public String[] getSourceEndowmentAccountingLineFormat(); 029 030 /** 031 * @return <code>TargetEndowmentAccountingLine</code> attribute format 032 */ 033 public String[] getTargetEndowmentAccountingLineFormat(); 034 035 /** 036 * @param accountingLineClass 037 * @return String representation of the <code>String[]</code> attribute format with each attribute separated by a comma. 038 */ 039 public String getExpectedEndowmentAccountingLineFormatAsString(Class<? extends EndowmentAccountingLine> accountingLineClass); 040 041 /** 042 * Parses a comma delimited string into an <code>SourceEndowmentAccountingLine</code> by populating the attributes found in the 043 * getSourceAccountingLineFormat() 044 * 045 * @param transactionalDocument 046 * @param sourceAccountingLineString 047 * @return SourceEndowmentAccountingLine 048 */ 049 public SourceEndowmentAccountingLine parseSourceEndowmentAccountingLine(EndowmentAccountingLinesDocument transactionalDocument, String sourceAccountingLineString); 050 051 /** 052 * Parses a comma delimited string into an <code>TargetEndowmentAccountingLine</code> by populating the attributes found in the 053 * getTargetAccountingLineFormat() 054 * 055 * @param transactionalDocument 056 * @param targetAccountingLineString 057 * @return TargetEndowmentAccountingLine 058 */ 059 public TargetEndowmentAccountingLine parseTargetEndowmentAccountingLine(EndowmentAccountingLinesDocument transactionalDocument, String targetAccountingLineString); 060 061 /** 062 * Generates a list of <code>SourceEndowmentAccountingLine</code> from the inputStream 063 * 064 * @param stream 065 * @param document 066 * @return List containing <code>SourceEndowmentAccountingLine</code>s 067 */ 068 public List<SourceEndowmentAccountingLine> importSourceEndowmentAccountingLines(String fileName, InputStream stream, EndowmentAccountingLinesDocument document); 069 070 /** 071 * Generates a list of <code>TargetEndowmentAccountingLine</code> from the inputStream 072 * 073 * @param stream 074 * @param document 075 * @return List containing <code>TargetEndowmentAccountingLine</code>s 076 */ 077 public List<TargetEndowmentAccountingLine> importTargetEndowmentAccountingLines(String fileName, InputStream stream, EndowmentAccountingLinesDocument document); 078 079 }