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