Statistics
| Revision:

root / branches / piloto3d / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / writers / AbstractWriter.java @ 9524

History | View | Annotate | Download (1.61 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.IRowEdited;
8
import com.iver.cit.gvsig.fmap.edition.IWriter;
9

    
10
public abstract class AbstractWriter implements IWriter {
11
        protected Properties capabilities = new Properties();
12
        protected ITableDefinition tableDef;
13
        protected boolean bWriteAll = false;
14
        
15
        /**
16
         * A developer can use this Properties for his own purposes. For example, to
17
         * let his extension know something about one writer.
18
         * @param capability
19
         * @return A message describing the capability. Null if not supported.
20
         */
21
        public String getCapability(String capability)
22
        {
23
                if (capabilities.containsKey(capability))
24
                        return capabilities.getProperty(capability);
25
                return null;
26
        }
27

    
28
        /**
29
         * @param capabilities The capabilities to set.
30
         */
31
        public void setCapabilities(Properties capabilities) {
32
                this.capabilities = capabilities;
33
        }
34

    
35
        // public abstract boolean canWriteGeometry(int gvSIGgeometryType);
36
        public abstract boolean canWriteAttribute(int sqlType);
37
        
38
        
39
        public void initialize(ITableDefinition tableDefinition) throws EditionException {
40
                this.tableDef = tableDefinition;
41
                
42
        }
43

    
44
        public ITableDefinition getTableDefinition() {
45
                return tableDef;
46
        }
47

    
48
        /**
49
         * @return Returns the bWriteAll. By default, is false => suitable for jdbc
50
         */
51
        public boolean isWriteAll() {
52
                return bWriteAll;
53
        }
54

    
55
        /**
56
         * @param writeAll
57
         *            The bWriteAll to set.
58
         */
59
        public void setWriteAll(boolean writeAll) {
60
                bWriteAll = writeAll;
61
        }
62

    
63

    
64
}