Lines 23-28
Link Here
|
23 |
* @since 3.1 |
23 |
* @since 3.1 |
24 |
*/ |
24 |
*/ |
25 |
public interface IContentTypeMatcher { |
25 |
public interface IContentTypeMatcher { |
|
|
26 |
|
27 |
/** |
28 |
* A client-provided registry containing objects that are related to content types. Implementations |
29 |
* of this interface collaborate with the content type infrastructure in order to support lookup |
30 |
* of content type related objects. |
31 |
* <p> |
32 |
* Clients may implement this interface. |
33 |
* </p> |
34 |
* |
35 |
* @see IContentTypeMatcher#findRelatedObjects(IContentType, String, IRelatedRegistry) |
36 |
*/ |
37 |
interface IRelatedRegistry { |
38 |
/** |
39 |
* Returns all objects in this client-provided registry that are directly related to the given |
40 |
* content type. |
41 |
* |
42 |
* @param type a content type |
43 |
* @return an array containing all objects directly related to the given content type |
44 |
*/ |
45 |
Object[] getRelatedObjects(IContentType type); |
46 |
|
47 |
/** |
48 |
* Returns all objects in this client-provided registry that are directly related to the given |
49 |
* file name. |
50 |
* <p> |
51 |
* This method is optional. It only has to be implemented if this registry supports |
52 |
* file name based association in addition to content type based association. |
53 |
* Otherwise, it can throw <code>UnsupportedOperationException</code>. |
54 |
* </p> |
55 |
* |
56 |
* @param fileName a file name |
57 |
* @return an array containing all objects directly related to the given file name |
58 |
* @throws UnsupportedOperationException if this registry does not support file |
59 |
* name based association |
60 |
*/ |
61 |
Object[] getRelatedObjects(String fileName); |
62 |
} |
63 |
|
26 |
/** |
64 |
/** |
27 |
* Returns the preferred content type for the given contents and file name. |
65 |
* Returns the preferred content type for the given contents and file name. |
28 |
* <p> |
66 |
* <p> |
Lines 90-95
Link Here
|
90 |
* @return all content types associated to the given file spec |
128 |
* @return all content types associated to the given file spec |
91 |
*/ |
129 |
*/ |
92 |
public IContentType[] findContentTypesFor(String fileName); |
130 |
public IContentType[] findContentTypesFor(String fileName); |
|
|
131 |
|
132 |
/** |
133 |
* Returns all objects in the given content type-related registry that are |
134 |
* related to the content type and file name specified. This method will walk |
135 |
* the content type hierarchy tree up to a root content type, collecting all related |
136 |
* objects from the given registry. |
137 |
* <p> |
138 |
* The file name is optional, and has to be omitted if the given registry |
139 |
* does not support file name based associations. |
140 |
* </p> |
141 |
* |
142 |
* @param type a content type |
143 |
* @param fileName the name of the file, or <code>null</code> |
144 |
* @param registry a related registry |
145 |
* @return all objects in the related registry that are associated to the |
146 |
* content type |
147 |
*/ |
148 |
public Object[] findRelatedObjects(IContentType type, String fileName, IRelatedRegistry registry); |
93 |
|
149 |
|
94 |
/** |
150 |
/** |
95 |
* Tries to obtain a description for the given contents and file name. |
151 |
* Tries to obtain a description for the given contents and file name. |