1 /* 2 * JBoss, the OpenSource J2EE webOS 3 * 4 * Distributable under LGPL license. See terms of license at gnu.org. 5 */ 6 7 package javax.emb; 8 9 import java.io.Serializable; 10 11 /** 12 * An instance of a class implementing this interface collects all properties 13 * necessary to perform a conversion from a specific source format to a 14 * specific target format. One or more converter spec classes correspond to one 15 * converter class, and the contract for accessing the conversion parameters is 16 * up to the implementers of the converter spec classes. 17 * 18 * <p>A conversion spec instance can be reused for multiple conversions. Also, 19 * implementations of this interface must provide a default constructor that 20 * initializes all properties with suitable values, in order to allow default 21 * conversions. As converter specs sometimes have to be transferred over 22 * machine boundaries, this interface extends {@link java.io.Serializable}. 23 * The design allows various parties to come up with implementations for 24 * various combinations of media formats. 25 * 26 * @version <tt>$Revision: 1.3 $</tt> 27 * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo 28 * Argüello</a> 29 */ 30 public interface MediaConverterSpec extends Serializable 31 { 32 /** 33 * Returns an object implementing the {@link MediaConverter}interface that 34 * can be used to process conversions using the receiver. The instance 35 * returned is initialized with the receiver to define the conversion 36 * specific parameters. 37 * 38 * @return the media converter. 39 * @throws MediaException if the instantiation of the converter fails. 40 */ 41 MediaConverter getConverter() throws MediaException; 42 43 /** 44 * Returns a MIME type as a String that can be used as a default for media 45 * objects created using the receiver. A result of <code>null</code> 46 * indicates that the receiver does not alter the media format of the 47 * content offered on the given input stream. 48 * 49 * @return the target MIME type. 50 */ 51 String getTargetMimeType(); 52 53 /** 54 * Returns a file extension as a String that can be used as a default for 55 * media objects created using the receiver. The String must not include any 56 * separator characters. A result of <code>null</code> indicates that the 57 * receiver does not alter the media format of the content offered on the 58 * given input stream. 59 * 60 * @return the target file extension. 61 */ 62 String getTargetFileExtension(); 63 }