1 /*
2 * (C) 2002 David Carr david@carr.name
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 package net.sourceforge.mflow.api;
20
21 import javax.activation.DataHandler;
22 import javax.activation.DataSource;
23
24 /***
25 * @author carrd
26 */
27 public abstract class ContentHandlerFactory {
28 /***
29 * The instance to return from {@link #getInstance()}
30 */
31 private static ContentHandlerFactory sInstance;
32
33 /***
34 * Sets the passed instance to be returned by {@link #getInstance()}
35 *
36 * @param aInstance the new instance to use
37 */
38 protected final void register(final ContentHandlerFactory aInstance) {
39 sInstance = aInstance;
40 }
41
42 /***
43 * @return an instance of {@link ContentHandlerFactory}
44 */
45 public static ContentHandlerFactory getInstance() {
46 return sInstance;
47 }
48
49 /***
50 * Creates an instance of {@link ContentHandler} with the given arguments
51 *
52 * @param obj the content for the {@link ContentHandler}
53 * @param mimeType the mime type for the {@link ContentHandler}
54 * @return a new instance of {@link ContentHandler}
55 */
56 public abstract ContentHandler createContentHandler(
57 final Object obj,
58 final String mimeType);
59
60 /***
61 * Creates an instance of {@link ContentHandler} with the given arguments
62 *
63 * @param aDataSource the {@link DataSource} to back the
64 * {@link ContentHandler}
65 * @return a new instance of {@link ContentHandler}
66 */
67 public abstract ContentHandler createContentHandler(
68 final DataSource aDataSource);
69
70 /***
71 * Creates an instance of {@link ContentHandler} with the given arguments
72 *
73 * @param aDataHandler the {@link DataHandler} to back the
74 * {@link ContentHandler}
75 * @return a new instance of {@link ContentHandler}
76 */
77 public abstract ContentHandler createContentHandler(
78 final DataHandler aDataHandler);
79 }
This page was automatically generated by Maven