View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.capabilities;
18  
19  import java.util.Collection;
20  
21  /***
22   * This entry describes all the properties that should be present in
23   * a RegistryEntry describing a MediaType
24   *
25   * FIXME: we should add some additionnal attrbutes for separating 2 versions
26   * of the same mime type
27   *
28   * @author <a href="mailto:raphael@apache.org">Rapha\u00ebl Luta</a>
29   * @version $Id: MediaType.java 517121 2007-03-12 07:45:49Z ate $
30   */
31  public interface MediaType
32  {
33      /***
34       * Set MediaType ID -- Assigns ID
35       * @param id
36       */
37      public void setMediatypeId(int id);
38  
39      /***
40       * Get MediaType ID -- Return ID
41       * @return MediaTypeID
42       */
43      public int getMediatypeId();
44  
45      /*** @return the character set associated with this MediaType */
46      public String getCharacterSet();
47  
48      /*** Sets the character set associated with this MediaType */
49      public void setCharacterSet(String charSet);
50  
51      /***
52       * Returns all supported capablities as <CODE>CapabilityMap</CODE>.
53       * The <CODE>CapabilityMap</CODE> contains all capabilities in arbitrary
54       * order.
55       *
56       * @return a collection of capabilities
57       */
58      public Collection getCapabilities();
59  
60      /***
61       * Set the capabilities
62       * @param vector of capabilities
63       */
64      public void setCapabilities(Collection capabilities);
65  
66      /***
67      * Returns all supported mimetypes as <CODE>MimeTypeMap</CODE>.
68      * The <CODE>MimeTypeMap</CODE> contains all mimetypes in decreasing
69      * order of importance.
70      *
71      * @return the MimeTypeMap
72      * @see MimeTypeMap
73      */
74      public Collection getMimetypes();
75  
76      /***
77       * Set mime types
78       * @param mimetypes
79       */
80      public void setMimetypes(Collection mimetypes);
81  
82      /***
83       * Removes the MimeType to the MimeType map 
84       * @param name of MimeType to remove
85       */
86  
87      public void removeMimetype(String name);
88  
89      /***
90       * Add MimeType to the MimeType map 
91       * @param name
92      
93      public void addMimetype(String name);
94   */
95      /***
96       * Add MimeType to the MimeType map 
97       * @param mimeType mimetype object to add
98        */
99      public void addMimetype(MimeType mimeType);
100     
101     
102     /***
103      * Add Capability to the Capability collection 
104      * @param capability capability object to add
105       */
106     public void addCapability(Capability capability);
107     
108     
109     
110     /***
111      * Set Name of MediaType
112      * @param name Name of MediaType
113      */
114     public void setName(String name);
115 
116     /***
117      * Get Name of MediaType
118      * @return Name of MediaType
119      */
120     public String getName();
121 
122     /***
123      * Get Title of MediaType
124      * @return Title of MediaType
125      */
126     public String getTitle();
127 
128     /***
129      * Set MediaType title
130      * @param title
131      */
132     public void setTitle(String title);
133 
134     /***
135      * Get MediaType description
136      * @return Returns description of MediaType
137      */
138     public String getDescription();
139 
140     /***
141      * Set description of MediaType
142      * @param desc Description string
143      */
144     public void setDescription(String desc);
145 }