root / branches / v2_0_0_prep / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / layers / operations / StringXMLItem.java @ 21200
History | View | Annotate | Download (3.1 KB)
1 |
package org.gvsig.fmap.mapcontext.layers.operations; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
4 |
import org.xml.sax.Attributes; |
5 |
import org.xml.sax.ContentHandler; |
6 |
import org.xml.sax.Locator; |
7 |
import org.xml.sax.SAXException; |
8 |
|
9 |
import com.iver.utiles.xmlViewer.TextXMLContent; |
10 |
|
11 |
public class StringXMLItem extends TextXMLContent implements XMLItem { |
12 |
|
13 |
FLayer layer; |
14 |
/**
|
15 |
* @param text
|
16 |
*/
|
17 |
public StringXMLItem(String text, FLayer lyr) { |
18 |
super(text);
|
19 |
this.layer = lyr;
|
20 |
|
21 |
} |
22 |
|
23 |
public FLayer getLayer(){
|
24 |
return this.layer; |
25 |
} |
26 |
/**
|
27 |
* @see com.iver.cit.gvsig.gui.toolListeners.InfoListener.XMLItem#parse(org.xml.sax.ContentHandler)
|
28 |
*/
|
29 |
public void parse(ContentHandler handler) throws SAXException { |
30 |
setContentHandler(new FilterContentHandler(handler));
|
31 |
parse(); |
32 |
} |
33 |
|
34 |
private class FilterContentHandler implements ContentHandler { |
35 |
|
36 |
private ContentHandler handler; |
37 |
|
38 |
public FilterContentHandler(ContentHandler handler) { |
39 |
this.handler = handler;
|
40 |
} |
41 |
|
42 |
/**
|
43 |
* @see org.xml.sax.ContentHandler#setDocumentLocator(org.xml.sax.Locator)
|
44 |
*/
|
45 |
public void setDocumentLocator(Locator arg0) { |
46 |
} |
47 |
|
48 |
/**
|
49 |
* @see org.xml.sax.ContentHandler#startDocument()
|
50 |
*/
|
51 |
public void startDocument() throws SAXException { |
52 |
} |
53 |
|
54 |
/**
|
55 |
* @see org.xml.sax.ContentHandler#endDocument()
|
56 |
*/
|
57 |
public void endDocument() throws SAXException { |
58 |
} |
59 |
|
60 |
/**
|
61 |
* @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
|
62 |
* java.lang.String)
|
63 |
*/
|
64 |
public void startPrefixMapping(String arg0, String arg1) |
65 |
throws SAXException {
|
66 |
} |
67 |
|
68 |
/**
|
69 |
* @see org.xml.sax.ContentHandler#endPrefixMapping(java.lang.String)
|
70 |
*/
|
71 |
public void endPrefixMapping(String arg0) throws SAXException { |
72 |
} |
73 |
|
74 |
/**
|
75 |
* @see org.xml.sax.ContentHandler#startElement(java.lang.String,
|
76 |
* java.lang.String, java.lang.String, org.xml.sax.Attributes)
|
77 |
*/
|
78 |
public void startElement(String arg0, String arg1, String arg2, |
79 |
Attributes arg3) throws SAXException { |
80 |
handler.startElement(arg0, arg1, arg2, arg3); |
81 |
} |
82 |
|
83 |
/**
|
84 |
* @see org.xml.sax.ContentHandler#endElement(java.lang.String,
|
85 |
* java.lang.String, java.lang.String)
|
86 |
*/
|
87 |
public void endElement(String arg0, String arg1, String arg2) |
88 |
throws SAXException {
|
89 |
handler.endElement(arg0, arg1, arg2); |
90 |
} |
91 |
|
92 |
/**
|
93 |
* @see org.xml.sax.ContentHandler#characters(char[], int, int)
|
94 |
*/
|
95 |
public void characters(char[] arg0, int arg1, int arg2) |
96 |
throws SAXException {
|
97 |
handler.characters(arg0, arg1, arg2); |
98 |
} |
99 |
|
100 |
/**
|
101 |
* @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int,
|
102 |
* int)
|
103 |
*/
|
104 |
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) |
105 |
throws SAXException {
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String,
|
110 |
* java.lang.String)
|
111 |
*/
|
112 |
public void processingInstruction(String arg0, String arg1) |
113 |
throws SAXException {
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
|
118 |
*/
|
119 |
public void skippedEntity(String arg0) throws SAXException { |
120 |
} |
121 |
|
122 |
} |
123 |
} |