root / tags / v1_0_2_Build_916 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / writers / AbstractWriter.java @ 12327
History | View | Annotate | Download (1.51 KB)
1 |
package com.iver.cit.gvsig.fmap.edition.writers; |
---|---|
2 |
|
3 |
import java.util.Properties; |
4 |
|
5 |
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition; |
6 |
import com.iver.cit.gvsig.fmap.edition.EditionException; |
7 |
import com.iver.cit.gvsig.fmap.edition.IWriter; |
8 |
|
9 |
public abstract class AbstractWriter implements IWriter { |
10 |
protected Properties capabilities = new Properties(); |
11 |
protected ITableDefinition tableDef;
|
12 |
protected boolean bWriteAll; |
13 |
|
14 |
/**
|
15 |
* A developer can use this Properties for his own purposes. For example, to
|
16 |
* let his extension know something about one writer.
|
17 |
* @param capability
|
18 |
* @return A message describing the capability. Null if not supported.
|
19 |
*/
|
20 |
public String getCapability(String capability) |
21 |
{ |
22 |
if (capabilities.containsKey(capability))
|
23 |
return capabilities.getProperty(capability);
|
24 |
return null; |
25 |
} |
26 |
|
27 |
/**
|
28 |
* @param capabilities The capabilities to set.
|
29 |
*/
|
30 |
public void setCapabilities(Properties capabilities) { |
31 |
this.capabilities = capabilities;
|
32 |
} |
33 |
|
34 |
// public abstract boolean canWriteGeometry(int gvSIGgeometryType);
|
35 |
public abstract boolean canWriteAttribute(int sqlType); |
36 |
|
37 |
|
38 |
public void initialize(ITableDefinition tableDefinition) throws EditionException { |
39 |
this.tableDef = tableDefinition;
|
40 |
|
41 |
} |
42 |
|
43 |
public ITableDefinition getTableDefinition() {
|
44 |
return tableDef;
|
45 |
} |
46 |
|
47 |
/**
|
48 |
* @return Returns the bWriteAll.
|
49 |
*/
|
50 |
public boolean isWriteAll() { |
51 |
return bWriteAll;
|
52 |
} |
53 |
|
54 |
/**
|
55 |
* @param writeAll
|
56 |
* The bWriteAll to set.
|
57 |
*/
|
58 |
public void setWriteAll(boolean writeAll) { |
59 |
bWriteAll = writeAll; |
60 |
} |
61 |
|
62 |
|
63 |
} |