Skip to content

Commit e59d461

Browse files
author
pborissow
committed
Removed dependencies on the javaxt-gis package
git-svn-id: svn://192.168.0.80/JavaXT/javaxt-rss@208 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent 2ae8bd3 commit e59d461

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

src/javaxt/rss/Feed.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import org.w3c.dom.*;
44
import javaxt.xml.DOM;
5-
import javaxt.geospatial.geometry.Geometry;
6-
import javaxt.geospatial.coordinate.Parser;
5+
//import javaxt.geospatial.geometry.Geometry;
6+
//import javaxt.geospatial.coordinate.Parser;
77

88
//******************************************************************************
99
//** RSS Feed
@@ -19,7 +19,7 @@ public class Feed {
1919
private String title = "";
2020
private String description = "";
2121
private java.net.URL link = null;
22-
private Geometry geometry = null;
22+
private Object geometry = null;
2323

2424
private javaxt.utils.Date lastUpdate = null;
2525
private Integer interval = null;
@@ -50,7 +50,14 @@ protected Feed(org.w3c.dom.Node node) {
5050
nodeName.equals("polygon") || nodeName.equals("georss:polygon") ||
5151
nodeName.equals("box") || nodeName.equals("georss:box")){
5252
try{
53-
geometry = new Parser(nodeValue).getGeometry();
53+
//geometry = new Parser(nodeValue).getGeometry();
54+
55+
Class classToLoad = Class.forName("javaxt.geospatial.coordinate.Parser");//, true, child);
56+
java.lang.reflect.Constructor constructor = classToLoad.getDeclaredConstructor(new Class[] {String.class});
57+
java.lang.reflect.Method method = classToLoad.getDeclaredMethod ("getGeometry");
58+
Object instance = constructor.newInstance();
59+
geometry = method.invoke(instance);
60+
5461
}
5562
catch(Exception e){}
5663
}
@@ -108,7 +115,7 @@ protected Feed(org.w3c.dom.Node node) {
108115
public String getDescription(){ return description; }
109116
public java.net.URL getLink(){ return link; }
110117
public Item[] getItems(){ return Items; }
111-
public Geometry getLocation(){ return geometry; }
118+
public Object getLocation(){ return geometry; }
112119

113120
public javaxt.utils.Date getLastUpdate(){
114121
return lastUpdate;

src/javaxt/rss/Item.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package javaxt.rss;
22
import org.w3c.dom.*;
33
import javaxt.xml.DOM;
4-
import javaxt.geospatial.geometry.Geometry;
5-
import javaxt.geospatial.coordinate.Parser;
4+
//import javaxt.geospatial.geometry.Geometry;
5+
//import javaxt.geospatial.coordinate.Parser;
66

77
//******************************************************************************
88
//** RSS Item
@@ -21,7 +21,7 @@ public class Item {
2121
private String creator = null;
2222
private java.net.URL link = null;
2323
private java.net.URL origLink = null; //<--FeedBurner
24-
private Geometry geometry = null;
24+
private Object geometry = null;
2525
private NodeList nodeList = null;
2626

2727
private String pubDate = null;
@@ -81,7 +81,12 @@ protected Item(org.w3c.dom.Node node) {
8181
nodeName.equals("polygon") || nodeName.equals("georss:polygon") ||
8282
nodeName.equals("box") || nodeName.equals("georss:box")){
8383
try{
84-
geometry = new Parser(nodeValue).getGeometry();
84+
//geometry = new Parser(nodeValue).getGeometry();
85+
Class classToLoad = Class.forName("javaxt.geospatial.coordinate.Parser");//, true, child);
86+
java.lang.reflect.Constructor constructor = classToLoad.getDeclaredConstructor(new Class[] {String.class});
87+
java.lang.reflect.Method method = classToLoad.getDeclaredMethod ("getGeometry");
88+
Object instance = constructor.newInstance();
89+
geometry = method.invoke(instance);
8590
}
8691
catch(Exception e){}
8792
}
@@ -154,7 +159,7 @@ public Media[] getMedia(){
154159
//**************************************************************************
155160
/** Returns a geometry associated with the current entry.
156161
*/
157-
public Geometry getLocation(){ return geometry; }
162+
public Object getLocation(){ return geometry; }
158163

159164

160165

@@ -175,8 +180,8 @@ public String toString(){
175180

176181
if (geometry!=null){
177182
out.append("Location: " + geometry + br);
178-
out.append("Geometry Name: " + geometry.getName() + br);
179-
out.append("Geometry SRS: " + geometry.getSRS() + br);
183+
//out.append("Geometry Name: " + geometry.getName() + br);
184+
//out.append("Geometry SRS: " + geometry.getSRS() + br);
180185
}
181186

182187
for (int i=0; i<media.size(); i++){

0 commit comments

Comments
 (0)