svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / layers / operations / VectorialXMLItem.java @ 21298
History | View | Annotate | Download (1.65 KB)
1 |
package org.gvsig.fmap.mapcontext.layers.operations; |
---|---|
2 |
|
3 |
import java.util.BitSet; |
4 |
|
5 |
import org.gvsig.data.ReadException; |
6 |
import org.gvsig.data.vectorial.FeatureCollection; |
7 |
import org.gvsig.data.vectorial.FeatureStore; |
8 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
9 |
import org.xml.sax.ContentHandler; |
10 |
import org.xml.sax.SAXException; |
11 |
import org.xml.sax.helpers.AttributesImpl; |
12 |
|
13 |
|
14 |
public class VectorialXMLItem implements XMLItem { |
15 |
|
16 |
private FeatureCollection selection;
|
17 |
private FLayer layer;
|
18 |
|
19 |
public VectorialXMLItem(FeatureCollection selection, FLayer layer) {
|
20 |
this.selection = selection;
|
21 |
this.layer = layer;
|
22 |
} |
23 |
|
24 |
public FLayer getLayer(){
|
25 |
return layer;
|
26 |
} |
27 |
/**
|
28 |
* @see com.iver.cit.gvsig.gui.toolListeners.InfoListener.XMLItem#parse(org.xml.sax.ContentHandler)
|
29 |
*/
|
30 |
public void parse(ContentHandler handler) throws SAXException { |
31 |
AttributesImpl aii = new AttributesImpl();
|
32 |
handler.startElement("", "", ((FLayer) layer).getName(), aii); |
33 |
try {
|
34 |
|
35 |
FeatureStore ds = ((AlphanumericData) layer).getFeatureStore(); |
36 |
//TODO
|
37 |
// ds.start();
|
38 |
//
|
39 |
// for (int j = bitset.nextSetBit(0); j >= 0; j = bitset
|
40 |
// .nextSetBit(j + 1)) {
|
41 |
// AttributesImpl ai = new AttributesImpl();
|
42 |
//
|
43 |
// for (int k = 0; k < ds.getFieldCount(); k++) {
|
44 |
// ai.addAttribute("", ds.getFieldName(k), "",
|
45 |
// "xs:string", ds.getFieldValue(j, k).toString());
|
46 |
// }
|
47 |
// handler.startElement("", "", String.valueOf(j), ai);
|
48 |
// handler.endElement("", "", String.valueOf(j));
|
49 |
// }
|
50 |
//
|
51 |
// ds.stop();
|
52 |
|
53 |
} catch (ReadException e) {
|
54 |
throw new SAXException(e); |
55 |
} |
56 |
handler.endElement("", "", ((FLayer) layer).getName()); |
57 |
} |
58 |
} |
59 |
|