/* SignalMLCodec.java created 2007-09-18 * */ package org.signalml.codec; import org.apache.log4j.Logger; /** SignalMLCodec * * * @author Michal Dobaczewski © 2007-2008 CC Otwarte Systemy Komputerowe Sp. z o.o. * based on code Copyright (C) 2003 Dobieslaw Ircha <dircha@eranet.pl> Artur Biesiadowski <abies@adres.pl> Piotr J. Durka <Piotr-J.Durka@fuw.edu.pl> */ public abstract class AbstractSignalMLCodec implements SignalMLCodec { protected static final Logger logger = Logger.getLogger(AbstractSignalMLCodec.class); private String formatName; private String description; // something veeeery spooky happening around this variable // (class files generated by the dynamic compiler disappearing from the filesystem) // if at all possible do not change the way this is handled private Class<?> readerDelegateClass = null; protected AbstractSignalMLCodec() { } public AbstractSignalMLCodec(String formatName) { super(); this.formatName = formatName; } public String getFormatName() { return formatName; } public void setFormatName(String formatName) { this.formatName = formatName; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public String toString() { return formatName; } @Override public SignalMLCodecReader createReader() throws SignalMLCodecException { synchronized (this) { if (readerDelegateClass == null) { readerDelegateClass = getReaderDelegateClass(); } } return new SignalMLCodecReaderImpl(readerDelegateClass, this); } public abstract Class<?> getReaderDelegateClass() throws SignalMLCodecException; }