root / branches / v2_0_0_prep / extensions / org.gvsig.mkmvnproject / templates / SPI / org.gvsig.fortunecookies / org.gvsig.fortunecookies.prov / org.gvsig.fortunecookies.prov.fileprovider / src / main / java / org / gvsig / fortunecookies / prov / fileprovider / impl / FortuneCookieFileProviderFactory.java @ 32378
History | View | Annotate | Download (2.09 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
|
24 |
import org.gvsig.tools.ToolsLocator; |
25 |
import org.gvsig.tools.dynobject.DynClass; |
26 |
import org.gvsig.tools.dynobject.DynObject; |
27 |
import org.gvsig.tools.service.ServiceException; |
28 |
import org.gvsig.tools.service.spi.Provider; |
29 |
import org.gvsig.tools.service.spi.ProviderFactory; |
30 |
import org.gvsig.tools.service.spi.ProviderServices; |
31 |
|
32 |
public class FortuneCookieFileProviderFactory implements ProviderFactory{ |
33 |
public static final String PROVIDER_NAME = "FortuneCookie.providers.file"; |
34 |
public static final String PROVIDER_DESCRIPTION = ""; |
35 |
|
36 |
private DynClass dynclass;
|
37 |
|
38 |
public Provider create(DynObject parameters, ProviderServices services) throws ServiceException { |
39 |
return new FortuneCookieFileProvider(services); |
40 |
} |
41 |
|
42 |
public DynObject createParameters() {
|
43 |
DynObject dynobject = ToolsLocator.getDynObjectManager().createDynObject(dynclass); |
44 |
dynobject.setDynValue("URL", "http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie"); |
45 |
return dynobject;
|
46 |
} |
47 |
|
48 |
public String getName() { |
49 |
return PROVIDER_NAME;
|
50 |
} |
51 |
|
52 |
public void initialize() { |
53 |
dynclass = ToolsLocator.getDynObjectManager().createDynClass(PROVIDER_NAME, PROVIDER_DESCRIPTION); |
54 |
dynclass.addDynFieldString("URL").setMandatory(true); |
55 |
} |
56 |
|
57 |
|
58 |
|
59 |
} |