KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > emb > GenericMediaHeader


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 /**
10  * This class offers a generic implementation of the MediaHeader interface. It
11  * is suitable for all kinds of media that don't expose any header information.
12  *
13  * @version <tt>$Revision: 1.3 $</tt>
14  * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo
15  * Argüello</a>
16  */

17 public final class GenericMediaHeader implements MediaHeader
18 {
19    /**
20     * Returns an empty array of Strings, as no header information is exposed.
21     *
22     * @return an empty array of Strings.
23     */

24    public String[] getFieldNames()
25    {
26       return new String[0];
27    }
28
29    /**
30     * Returns <code>null</code> regardless of the field name passed.
31     *
32     * @param fieldName a header field name.
33     * @return <code>null</code>
34     * @throws java.lang.NullPointerException if the value passed is <code>null</code>.
35     */

36    public Object getField(String fieldname)
37    {
38       if (fieldname == null)
39       {
40          throw new NullPointerException();
41       }
42
43       return null;
44    }
45 }
Popular Tags