Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.lib / org.gvsig.exportto.lib.impl / src / main / java / org / gvsig / export / impl / service / DefaultExportAttribute.java @ 44386

History | View | Annotate | Download (2.25 KB)

1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
package org.gvsig.export.impl.service;
7

    
8
import org.gvsig.export.ExportAttributes;
9
import org.gvsig.export.ExportAttributes.ExportAttribute;
10
import org.gvsig.export.spi.AttributeNamesTranslator;
11
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
12

    
13
public class DefaultExportAttribute implements ExportAttributes.ExportAttribute {
14

    
15
    private final FeatureAttributeDescriptor fad;
16
    private String newName = null;
17
    private int newDataType;
18
    private int size;
19
    private boolean exported;
20
//    private AttributeNamesTranslator translator = null;
21

    
22
    public DefaultExportAttribute(FeatureAttributeDescriptor fad) {
23
        this.fad = fad;
24

    
25
    }
26

    
27
    @Override
28
    public FeatureAttributeDescriptor getDescriptor() {
29
        return this.fad;
30
    }
31

    
32
    @Override
33
    public String getName() {
34
        return this.fad.getName();
35
    }
36

    
37
    @Override
38
    public int getDataType() {
39
        return this.fad.getDataType().getType();
40
    }
41

    
42
    @Override
43
    public String getNewName() {
44
        if (this.newName == null) {
45
            return this.getName();
46
        }
47
        return this.newName;
48
    }
49

    
50
    public int getNewDataType() {
51

    
52
        return this.newDataType;
53
    }
54

    
55
    @Override
56
    public boolean isExported() {
57
        return this.exported;
58
    }
59

    
60
    @Override
61
    public void setNewName(String name) {
62
        this.newName = name;
63
    }
64

    
65
    @Override
66
    public void setExported(boolean exported) {
67
        this.exported = exported;
68
    }
69

    
70
    @Override
71
    public void setNewType(int dataType) {
72
        this.newDataType = dataType;
73
    }
74

    
75
    @Override
76
    public int getSize() {
77
        return this.size;
78
    }
79

    
80
    @Override
81
    public void setSize(int size) {
82
        this.size = size;
83
    }
84

    
85
    @Override
86
    public ExportAttribute clone() throws CloneNotSupportedException {
87
       DefaultExportAttribute clone = new DefaultExportAttribute((FeatureAttributeDescriptor) fad.clone());
88
       clone.setExported(this.exported);
89
       clone.setNewName(this.newName);
90
       clone.setNewType(this.newDataType);
91
       clone.setSize(this.size);
92
       return clone;
93
    }
94
    
95
}