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.EndowmentTransactionLinesDocument;
022
023 // Bonnie: refer to AccountingLineParser
024 /**
025 * Defines an abstraction for parsing serialized <code>EndowmentTransactionLine</code>
026 */
027 public interface EndowmentTransactionLineParser {
028 /**
029 * @return EndowmentSourceTransactionLine attribute format
030 */
031 public String[] getSourceTransactionLineFormat();
032
033 /**
034 * @return EndowmentTargetTransactionLine attribute format
035 */
036 public String[] getTargetTransactionLineFormat();
037
038 /**
039 * @param transactionLineClass
040 * @return String representation of the <code>String[]</code> attribute format with each attribute separated by a comma.
041 */
042 public String getExpectedTransactionLineFormatAsString(Class<? extends EndowmentTransactionLine> transactionLineClass);
043
044 /**
045 * parses a comma deliminated string into an <code>EndowmentSourceTransactionLine</code> by populating the attributes found in the
046 * getSourceTransactionLineFormat()
047 *
048 * @param transactionalDocument
049 * @param sourceTransactionLineString
050 * @return EndowmentSourceTransactionLine
051 */
052 // public EndowmentSourceTransactionLine parseSourceTransactionLine(EndowmentTransactionLinesDocument transactionalDocument, String sourceTransactionLineString);
053
054 /**
055 * parses a comma deliminated string into an <code>EndowmentTargetTransactionLine</code> by populating the attributes found in the
056 * getTargetTransactionLineFormat()
057 *
058 * @param transactionalDocument
059 * @param targetTransactionLineString
060 * @return EndowmentTargetTransactionLine
061 */
062 // public EndowmentTargetTransactionLine parseTargetTransactionLine(EndowmentTransactionLinesDocument transactionalDocument, String targetTransactionLineString);
063
064 /**
065 * generates a list of EndowmentSourceTransactionLine from the inputStream
066 *
067 * @param stream
068 * @param document
069 * @return List containing EndowmentSourceTransactionLine
070 */
071 public List importEndowmentSourceTransactionLines(String fileName, InputStream stream, EndowmentTransactionLinesDocument document);
072
073 /**
074 * generates a list of EndowmentTargetTransactionLine from the inputStream
075 *
076 * @param stream
077 * @param document
078 * @return List containing EndowmentTargetTransactionLine
079 */
080 public List importEndowmentTargetTransactionLines(String fileName, InputStream stream, EndowmentTransactionLinesDocument document);
081
082 }