1 /** 2 * 3 */ 4 package org.treetank.api; 5 6 import java.io.DataInput; 7 8 import org.treetank.bucket.DumbDataFactory; 9 import org.treetank.exception.TTIOException; 10 11 import com.google.inject.ImplementedBy; 12 13 /** 14 * Factory to generate datas out of raw data. Depending on the kind of data, this factory simple generate 15 * datas for the {@link IData} interface. 16 * 17 * The interface is the counterpart to the serialization-method 18 * {@link org.treetank.api.IData#serialize(java.io.DataOutput)}. 19 * 20 * @author Sebastian Graf, University of Konstanz 21 * 22 */ 23 @ImplementedBy(DumbDataFactory.class) 24 public interface IDataFactory { 25 26 /** 27 * Create a data out of a serialized byte-representation. 28 * 29 * @param pData 30 * byte representation. 31 * @return the created data. 32 * @throws TTIOException 33 * if any weird happens 34 */ 35 IData deserializeData(final DataInput pData) throws TTIOException; 36 37 }