svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / spi / AbstractDataServerExplorerFactory.java @ 43020
History | View | Annotate | Download (1.72 KB)
1 |
|
---|---|
2 |
package org.gvsig.fmap.dal.spi; |
3 |
|
4 |
import org.apache.commons.lang3.StringUtils; |
5 |
import org.gvsig.fmap.dal.DataFactoryUnit; |
6 |
import org.gvsig.fmap.dal.DataServerExplorerFactory; |
7 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
8 |
import static org.gvsig.fmap.dal.DataStoreProviderFactory.UNKNOWN; |
9 |
import org.gvsig.fmap.dal.exception.InitializeException; |
10 |
import org.gvsig.tools.dynobject.DynObject; |
11 |
import org.gvsig.tools.service.spi.Services; |
12 |
|
13 |
public abstract class AbstractDataServerExplorerFactory |
14 |
implements DataServerExplorerFactory {
|
15 |
private String name = null; |
16 |
private String description = ""; |
17 |
|
18 |
|
19 |
protected AbstractDataServerExplorerFactory(String name, String description) { |
20 |
this.name = name;
|
21 |
this.description = description;
|
22 |
} |
23 |
|
24 |
@Override
|
25 |
public DataFactoryUnit create(DynObject parameters, Services services) {
|
26 |
try {
|
27 |
return this.create( |
28 |
(DataServerExplorerParameters)parameters, |
29 |
(DataServerExplorerProviderServices)services |
30 |
); |
31 |
} catch (InitializeException ex) {
|
32 |
throw new RuntimeException(ex); |
33 |
} |
34 |
} |
35 |
|
36 |
@Override
|
37 |
public final String getName() { |
38 |
return this.name; |
39 |
} |
40 |
|
41 |
@Override
|
42 |
public final String getDescription() { |
43 |
if( StringUtils.isEmpty(this.description) ) { |
44 |
return this.name; |
45 |
} |
46 |
return this.description; |
47 |
} |
48 |
|
49 |
@Override
|
50 |
public int allowCreate() { |
51 |
return UNKNOWN;
|
52 |
} |
53 |
|
54 |
@Override
|
55 |
public int hasTabularSupport() { |
56 |
return UNKNOWN;
|
57 |
} |
58 |
|
59 |
@Override
|
60 |
public int hasVectorialSupport() { |
61 |
return UNKNOWN;
|
62 |
} |
63 |
|
64 |
@Override
|
65 |
public int hasRasterSupport() { |
66 |
return UNKNOWN;
|
67 |
} |
68 |
} |