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 * The interface MediaHeader defines the common behavior between media header 13 * implementations. All media header instances must allow access to the format 14 * specific header fields by name, in order to allow easy generic access in 15 * case some information is required for browsing purposes. Additionally, all 16 * header fields accessible by the <code>MediaHeader.getField(String)</code> 17 * method must be accessible by standard getter methods, too. As media header 18 * instances have to be transferred over machine boundaries at times, this 19 * interface extends {@link java.io.Serializable}. 20 * 21 * @version <tt>$Revision: 1.4 $</tt> 22 * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo 23 * Argüello</a> 24 */ 25 public interface MediaHeader extends Serializable 26 { 27 /** 28 * Returns an array of Strings containing all the field names defined for 29 * the header. 30 * 31 * @return an array of header field names. 32 */ 33 String[] getFieldNames(); 34 35 /** 36 * Returns the field with the given name downcast to 37 * {@link java.lang.Object}. If the field is modeled as a Java base type, 38 * an instance of the corresponding wrapper class has to be returned. The 39 * value <code>null</code> is returned if a field name is passed that is 40 * not defined for the receiver. 41 * 42 * @param fieldName header field name. 43 * @return the content of a header field. 44 * @throws java.lang.NullPointerException if the value passed is <code>null</code>. 45 */ 46 Object getField(String fieldName); 47 }