Formatted and cleaned up code
This commit is contained in:
parent
cfd85a7986
commit
6e2a56066b
220 changed files with 4416 additions and 4196 deletions
|
@ -28,6 +28,11 @@ import com.sun.syndication.feed.atom.Entry;
|
|||
*/
|
||||
public abstract class ActivityObject extends Entry implements HasLocation {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public abstract String getTypeIRI();
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,6 +44,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
* @author robert.cooper
|
||||
*/
|
||||
public class Article extends ActivityObject {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/article";
|
||||
|
|
|
@ -41,6 +41,10 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
* @author robert.cooper
|
||||
*/
|
||||
public class Audio extends ActivityObject {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String embedCode;
|
||||
private String streamLink;
|
||||
|
||||
|
|
|
@ -66,6 +66,11 @@ import com.sun.syndication.feed.atom.Link;
|
|||
*/
|
||||
public class Bookmark extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/bookmark";
|
||||
|
|
|
@ -49,6 +49,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Comment extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/comment";
|
||||
|
|
|
@ -44,6 +44,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Event extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/event";
|
||||
|
|
|
@ -48,6 +48,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class File extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/file";
|
||||
|
|
|
@ -42,6 +42,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Folder extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/folder";
|
||||
|
|
|
@ -32,6 +32,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class List extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/list";
|
||||
|
|
|
@ -47,6 +47,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Note extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/note";
|
||||
|
|
|
@ -46,6 +46,11 @@ import com.sun.syndication.feed.atom.Link;
|
|||
*/
|
||||
public class Person extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/person";
|
||||
|
|
|
@ -44,6 +44,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Photo extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/photo";
|
||||
|
|
|
@ -41,6 +41,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class PhotoAlbum extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/photo-album";
|
||||
|
|
|
@ -44,6 +44,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Place extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/place";
|
||||
|
|
|
@ -33,6 +33,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Playlist extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/playlist";
|
||||
|
|
|
@ -44,6 +44,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Product extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/product";
|
||||
|
|
|
@ -51,6 +51,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Review extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/review";
|
||||
|
|
|
@ -43,6 +43,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Service extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/service";
|
||||
|
|
|
@ -36,6 +36,10 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
* @author robert.cooper
|
||||
*/
|
||||
public class Song extends ActivityObject {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Audio audio;
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,6 +40,11 @@ package org.rometools.feed.module.activitystreams.types;
|
|||
*/
|
||||
public class Status extends ActivityObject {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String getTypeIRI() {
|
||||
return "http://activitystrea.ms/schema/1.0/status";
|
||||
|
|
|
@ -31,6 +31,10 @@ import com.sun.syndication.feed.CopyFrom;
|
|||
*/
|
||||
public class CustomTagsImpl implements CustomTags {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List values;
|
||||
|
||||
/** Creates a new instance of CustomTagsImpl */
|
||||
|
|
|
@ -53,7 +53,7 @@ import com.sun.syndication.feed.module.Module;
|
|||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
public interface GoogleBase extends Module, Article, Course, Event, Job, Person, Product, Review, ScholarlyArticle, Service, Travel, Unknown, Vehicle, Wanted,
|
||||
Housing {
|
||||
Housing {
|
||||
/** This is the URI for the Google Base Schema. */
|
||||
public static final String URI = "http://base.google.com/ns/1.0";
|
||||
}
|
||||
|
|
|
@ -65,6 +65,11 @@ import com.sun.syndication.feed.impl.EqualsBean;
|
|||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public class GoogleBaseImpl implements GoogleBase {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** boolean:listing_type */
|
||||
private Boolean listingType;
|
||||
|
||||
|
|
|
@ -28,6 +28,11 @@ package org.rometools.feed.module.base;
|
|||
*/
|
||||
public class ValidationException extends RuntimeException {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of ValidationException */
|
||||
public ValidationException(final String message) {
|
||||
super(message);
|
||||
|
|
|
@ -95,7 +95,7 @@ public class CustomTagParser implements ModuleParser {
|
|||
try {
|
||||
tags.add(new CustomTagImpl(child.getName(), new DateTimeRange(GoogleBaseParser.LONG_DT_FMT.parse(child
|
||||
.getChild("start", CustomTagParser.NS).getText().trim()), GoogleBaseParser.LONG_DT_FMT.parse(child
|
||||
.getChild("end", CustomTagParser.NS).getText().trim()))));
|
||||
.getChild("end", CustomTagParser.NS).getText().trim()))));
|
||||
} catch (final Exception e) {
|
||||
log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,11 @@ import java.util.Date;
|
|||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
public class ShortDate extends Date implements CloneableType {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of ShortDate */
|
||||
public ShortDate() {
|
||||
super();
|
||||
|
|
|
@ -54,6 +54,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
*/
|
||||
public class CreativeCommonsImpl implements CreativeCommons {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
||||
public static final String RSS2_URI = "http://backend.userland.com/creativeCommonsRssModule";
|
||||
public static final String RSS1_URI = "http://web.resource.org/cc/";
|
||||
|
|
|
@ -53,6 +53,10 @@ import com.sun.syndication.feed.CopyFrom;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImpl implements ContentModule {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List encodeds;
|
||||
private List contents;
|
||||
private List contentItems;
|
||||
|
|
|
@ -66,7 +66,6 @@ public class GMLGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -76,7 +75,6 @@ public class GMLGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
|
||||
*/
|
||||
@Override
|
||||
|
@ -86,7 +84,6 @@ public class GMLGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -25,13 +25,17 @@ package org.rometools.feed.module.georss;
|
|||
*/
|
||||
public class GMLModuleImpl extends GeoRSSModule {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public GMLModuleImpl() {
|
||||
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GML_URI);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#getInterface()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -43,7 +43,6 @@ public class GMLParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -53,7 +52,6 @@ public class GMLParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -31,6 +31,11 @@ import com.sun.syndication.feed.module.ModuleImpl;
|
|||
* @version $Id: GeoRSSModule.java,v 1.8 2007/06/06 09:47:32 marcwick Exp $
|
||||
*/
|
||||
public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected AbstractGeometry geometry;
|
||||
|
||||
public static final String version = "0.9.8";
|
||||
|
@ -114,7 +119,6 @@ public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -76,9 +76,7 @@ public class GeoRSSUtils {
|
|||
/*
|
||||
* if (geoRSSModule == null && w3cGeo != null) { geoRSSModule = w3cGeo; } else if (geoRSSModule == null && gml != null) { geoRSSModule = gml; } else if
|
||||
* (geoRSSModule != null && w3cGeo != null) { // sanity check if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) { throw new
|
||||
* Error("geometry of simple and w3c do not match"); } }
|
||||
*
|
||||
* return geoRSSModule;
|
||||
* Error("geometry of simple and w3c do not match"); } } return geoRSSModule;
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -107,9 +105,7 @@ public class GeoRSSUtils {
|
|||
/*
|
||||
* if (geoRSSModule == null && w3cGeo != null) { geoRSSModule = w3cGeo; } else if (geoRSSModule == null && gml != null) { geoRSSModule = gml; } else if
|
||||
* (geoRSSModule != null && w3cGeo != null) { // sanity check if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) { throw new
|
||||
* Error("geometry of simple and w3c do not match"); } }
|
||||
*
|
||||
* return geoRSSModule;
|
||||
* Error("geometry of simple and w3c do not match"); } } return geoRSSModule;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@ public class SimpleGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -70,7 +69,6 @@ public class SimpleGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
|
||||
*/
|
||||
@Override
|
||||
|
@ -80,7 +78,6 @@ public class SimpleGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -24,13 +24,17 @@ package org.rometools.feed.module.georss;
|
|||
*
|
||||
*/
|
||||
public class SimpleModuleImpl extends GeoRSSModule {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public SimpleModuleImpl() {
|
||||
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GEORSS_URI);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#getInterface()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -41,7 +41,6 @@ public class SimpleParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -61,7 +60,6 @@ public class SimpleParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -53,7 +53,6 @@ public class W3CGeoGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -63,7 +62,6 @@ public class W3CGeoGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
|
||||
*/
|
||||
@Override
|
||||
|
@ -73,7 +71,6 @@ public class W3CGeoGenerator implements ModuleGenerator {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -25,13 +25,17 @@ package org.rometools.feed.module.georss;
|
|||
*/
|
||||
public class W3CGeoModuleImpl extends GeoRSSModule {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public W3CGeoModuleImpl() {
|
||||
super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#getInterface()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -36,7 +36,6 @@ public class W3CGeoParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -71,7 +70,6 @@ public class W3CGeoParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,11 @@ package org.rometools.feed.module.georss.geometries;
|
|||
*/
|
||||
public abstract class AbstractCurve extends AbstractGeometricPrimitive {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of Curve */
|
||||
public AbstractCurve() {
|
||||
}
|
||||
|
|
|
@ -16,6 +16,11 @@ package org.rometools.feed.module.georss.geometries;
|
|||
*/
|
||||
public abstract class AbstractGeometricPrimitive extends AbstractGeometry {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of GeometricPrimitive */
|
||||
public AbstractGeometricPrimitive() {
|
||||
|
||||
|
|
|
@ -18,6 +18,11 @@ import java.io.Serializable;
|
|||
*/
|
||||
public abstract class AbstractGeometry implements Cloneable, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of Geometry */
|
||||
public AbstractGeometry() {
|
||||
}
|
||||
|
|
|
@ -18,6 +18,11 @@ import java.io.Serializable;
|
|||
*/
|
||||
public abstract class AbstractRing implements Cloneable, Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of AbstractRing */
|
||||
public AbstractRing() {
|
||||
}
|
||||
|
|
|
@ -16,6 +16,11 @@ package org.rometools.feed.module.georss.geometries;
|
|||
*/
|
||||
public abstract class AbstractSurface extends AbstractGeometricPrimitive {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Creates a new instance of Surface */
|
||||
public AbstractSurface() {
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ package org.rometools.feed.module.georss.geometries;
|
|||
* @author runaas
|
||||
*/
|
||||
public class Envelope extends AbstractGeometry {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected double minLatitude, minLongitude, maxLatitude, maxLongitude;
|
||||
|
||||
/** Creates a new instance of Envelope */
|
||||
|
|
|
@ -15,6 +15,10 @@ package org.rometools.feed.module.georss.geometries;
|
|||
* @author runaas
|
||||
*/
|
||||
public final class LineString extends AbstractCurve {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private PositionList posList;
|
||||
|
||||
/** Creates a new instance of LineString */
|
||||
|
|
|
@ -15,6 +15,10 @@ package org.rometools.feed.module.georss.geometries;
|
|||
* @author runaas
|
||||
*/
|
||||
public final class LinearRing extends AbstractRing {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private PositionList posList;
|
||||
|
||||
/** Creates a new instance of LinearLing */
|
||||
|
|
|
@ -15,6 +15,10 @@ package org.rometools.feed.module.georss.geometries;
|
|||
* @author runaas
|
||||
*/
|
||||
public final class Point extends AbstractGeometricPrimitive {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Position pos;
|
||||
|
||||
/** Creates a new instance of Point */
|
||||
|
|
|
@ -19,6 +19,10 @@ import java.util.List;
|
|||
* @author runaas
|
||||
*/
|
||||
public final class Polygon extends AbstractSurface implements Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private AbstractRing exterior;
|
||||
private List interior;
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ import java.io.Serializable;
|
|||
* @author runaas
|
||||
*/
|
||||
public class Position implements Cloneable, Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ import java.io.Serializable;
|
|||
* @author runaas
|
||||
*/
|
||||
public class PositionList implements Cloneable, Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private double[] latitude;
|
||||
private double[] longitude;
|
||||
private int size;
|
||||
|
|
|
@ -49,6 +49,11 @@ import com.sun.syndication.feed.CopyFrom;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public abstract class AbstractITunesObject implements ITunes, java.lang.Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The URI that iTunes used for its custom tags.
|
||||
* <p>
|
||||
|
|
|
@ -51,6 +51,10 @@ import com.sun.syndication.feed.CopyFrom;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class EntryInformationImpl extends AbstractITunesObject implements EntryInformation {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Duration duration;
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,6 +56,10 @@ import com.sun.syndication.feed.CopyFrom;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class FeedInformationImpl extends AbstractITunesObject implements FeedInformation {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String ownerName;
|
||||
private String ownerEmailAddress;
|
||||
private URL image;
|
||||
|
|
|
@ -49,6 +49,10 @@ import java.io.Serializable;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Category implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String name;
|
||||
private Subcategory subcategory;
|
||||
|
||||
|
|
|
@ -52,6 +52,10 @@ import com.sun.syndication.io.impl.NumberParser;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Duration implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
static final long SECOND = 1000;
|
||||
static final long MINUTE = SECOND * 60;
|
||||
static final long HOUR = MINUTE * 60;
|
||||
|
@ -99,18 +103,18 @@ public class Duration implements Serializable {
|
|||
public Duration(final String duration) {
|
||||
final StringTokenizer tok = new StringTokenizer(duration, ":");
|
||||
switch (tok.countTokens()) {
|
||||
case 1:
|
||||
setMilliseconds((long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
case 2:
|
||||
setMilliseconds(NumberParser.parseLong(tok.nextToken(), 0l) * MINUTE + (long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
case 3:
|
||||
setMilliseconds(NumberParser.parseLong(tok.nextToken(), 0l) * HOUR + NumberParser.parseLong(tok.nextToken(), 0l) * MINUTE
|
||||
+ (long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Illegal time value: " + duration);
|
||||
case 1:
|
||||
setMilliseconds((long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
case 2:
|
||||
setMilliseconds(NumberParser.parseLong(tok.nextToken(), 0l) * MINUTE + (long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
case 3:
|
||||
setMilliseconds(NumberParser.parseLong(tok.nextToken(), 0l) * HOUR + NumberParser.parseLong(tok.nextToken(), 0l) * MINUTE
|
||||
+ (long) (NumberParser.parseFloat(tok.nextToken(), 0f) * SECOND));
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Illegal time value: " + duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,10 @@ import java.io.Serializable;
|
|||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
public class Subcategory implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String name;
|
||||
|
||||
/** Creates a new instance of SubCategory */
|
||||
|
|
|
@ -67,7 +67,6 @@ public class MediaModuleParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
|
||||
*/
|
||||
@Override
|
||||
|
@ -78,7 +77,6 @@ public class MediaModuleParser implements ModuleParser {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -131,7 +131,6 @@ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
|
@ -152,7 +151,6 @@ public class OpenSearchModuleImpl extends ModuleImpl implements OpenSearchModule
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.sun.syndication.feed.CopyFrom#getInterface()
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -154,21 +154,21 @@ public class OpenSearchModuleParser implements ModuleParser {
|
|||
final Link link = new Link();
|
||||
|
||||
String att = e.getAttributeValue("rel");// getAtomNamespace()); DONT
|
||||
// KNOW WHY DOESN'T WORK
|
||||
// KNOW WHY DOESN'T WORK
|
||||
|
||||
if (att != null) {
|
||||
link.setRel(att);
|
||||
}
|
||||
|
||||
att = e.getAttributeValue("type");// getAtomNamespace()); DONT KNOW WHY
|
||||
// DOESN'T WORK
|
||||
// DOESN'T WORK
|
||||
|
||||
if (att != null) {
|
||||
link.setType(att);
|
||||
}
|
||||
|
||||
att = e.getAttributeValue("href");// getAtomNamespace()); DONT KNOW WHY
|
||||
// DOESN'T WORK
|
||||
// DOESN'T WORK
|
||||
|
||||
if (att != null) {
|
||||
|
||||
|
@ -180,14 +180,14 @@ public class OpenSearchModuleParser implements ModuleParser {
|
|||
}
|
||||
|
||||
att = e.getAttributeValue("hreflang");// getAtomNamespace()); DONT KNOW
|
||||
// WHY DOESN'T WORK
|
||||
// WHY DOESN'T WORK
|
||||
|
||||
if (att != null) {
|
||||
link.setHreflang(att);
|
||||
}
|
||||
|
||||
att = e.getAttributeValue("length");// getAtomNamespace()); DONT KNOW
|
||||
// WHY DOESN'T WORK
|
||||
// WHY DOESN'T WORK
|
||||
|
||||
return link;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class PhotocastModuleImpl implements PhotocastModule {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date photoDate;
|
||||
private Date cropDate;
|
||||
private URL imageUrl;
|
||||
|
|
|
@ -52,6 +52,10 @@ import java.util.Date;
|
|||
*/
|
||||
public class PhotoDate extends Date {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long Y2K = 946616400531l;
|
||||
private static final double DAY = 24 * 60 * 60 * 1000;
|
||||
|
||||
|
|
|
@ -50,6 +50,11 @@ import com.sun.syndication.feed.impl.EqualsBean;
|
|||
*/
|
||||
public class SlashImpl implements Slash {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String section;
|
||||
|
||||
private String department;
|
||||
|
|
|
@ -28,6 +28,10 @@ import com.sun.syndication.feed.module.ModuleImpl;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class SimpleListExtensionImpl extends ModuleImpl implements SimpleListExtension {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String treatAs = "list";
|
||||
private Group[] groupFields;
|
||||
private Sort[] sortFields;
|
||||
|
|
|
@ -33,6 +33,10 @@ import com.sun.syndication.feed.impl.ObjectBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class SleEntryImpl implements SleEntry {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final EntryValue[] EMPTY_VALUES = new EntryValue[0];
|
||||
private final ObjectBean obj = new ObjectBean(SleEntryImpl.class, this);
|
||||
private EntryValue[] groupValues = EMPTY_VALUES;
|
||||
|
|
|
@ -150,6 +150,11 @@ public class SleUtility {
|
|||
}
|
||||
|
||||
private static class SortableList extends ArrayList {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public SortableList(final Collection c) {
|
||||
super(c);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ItemParser implements com.sun.syndication.io.ModuleParser {
|
|||
element.removeContent(group);
|
||||
}
|
||||
|
||||
sle.setGroupValues((EntryValue[]) values.toArray(new EntryValue[values.size()]));
|
||||
sle.setGroupValues(values.toArray(new EntryValue[values.size()]));
|
||||
values = values.size() == 0 ? values : new ArrayList<EntryValue>();
|
||||
|
||||
final List<Element> sorts = new ArrayList<Element>(element.getChildren("sort", ModuleParser.TEMP));
|
||||
|
@ -150,7 +150,7 @@ public class ItemParser implements com.sun.syndication.io.ModuleParser {
|
|||
}
|
||||
}
|
||||
// System.out.println("Values created "+values.size()+" from sorts" +sorts.size());
|
||||
sle.setSortValues((EntryValue[]) values.toArray(new EntryValue[values.size()]));
|
||||
sle.setSortValues(values.toArray(new EntryValue[values.size()]));
|
||||
|
||||
return sle;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class ModuleParser implements com.sun.syndication.io.ModuleParser {
|
|||
values.add(new Group(ns, elementName, label));
|
||||
}
|
||||
|
||||
sle.setGroupFields((Group[]) values.toArray(new Group[values.size()]));
|
||||
sle.setGroupFields(values.toArray(new Group[values.size()]));
|
||||
values = values.size() == 0 ? values : new ArrayList<Object>();
|
||||
|
||||
for (final Element se : listInfo.getChildren("sort", NS)) {
|
||||
|
@ -92,7 +92,7 @@ public class ModuleParser implements com.sun.syndication.io.ModuleParser {
|
|||
values.add(new Sort(ns, elementName, dataType, label, defaultOrder));
|
||||
}
|
||||
|
||||
sle.setSortFields((Sort[]) values.toArray(new Sort[values.size()]));
|
||||
sle.setSortFields(values.toArray(new Sort[values.size()]));
|
||||
insertValues(sle, element.getChildren());
|
||||
|
||||
return sle;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.rometools.feed.module.sse;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
@ -124,9 +123,9 @@ public class SSE091Generator implements DelegatingModuleGenerator {
|
|||
private void generateConflicts(final Element syncElement, final List<Conflict> conflicts) {
|
||||
if (conflicts != null) {
|
||||
final Element conflictsElement = new Element(Conflicts.NAME, SSEModule.SSE_NS);
|
||||
for (final Iterator<Conflict> confictIter = conflicts.iterator(); confictIter.hasNext();) {
|
||||
for (final Conflict conflict2 : conflicts) {
|
||||
final Element conflictElement = new Element(Conflict.NAME, SSEModule.SSE_NS);
|
||||
final Conflict conflict = (Conflict) confictIter.next();
|
||||
final Conflict conflict = conflict2;
|
||||
generateAttribute(conflictElement, Conflict.BY_ATTRIBUTE, conflict.getBy());
|
||||
generateAttribute(conflictElement, Conflict.VERSION_ATTRIBUTE, conflict.getVersion());
|
||||
generateAttribute(conflictElement, Conflict.WHEN_ATTRIBUTE, conflict.getWhen());
|
||||
|
@ -158,9 +157,8 @@ public class SSE091Generator implements DelegatingModuleGenerator {
|
|||
|
||||
private void generateUpdates(final Element historyElement, final List<Update> updates) {
|
||||
if (updates != null) {
|
||||
for (final Iterator<Update> updateIter = updates.iterator(); updateIter.hasNext();) {
|
||||
for (final Update update : updates) {
|
||||
final Element updateElement = new Element(Update.NAME, SSEModule.SSE_NS);
|
||||
final Update update = updateIter.next();
|
||||
generateAttribute(updateElement, Update.BY_ATTRIBUTE, update.getBy());
|
||||
generateAttribute(updateElement, Update.WHEN_ATTRIBUTE, update.getWhen());
|
||||
historyElement.addContent(updateElement);
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.rometools.feed.module.sse;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Logger;
|
||||
|
@ -119,12 +118,10 @@ public class SSE091Parser implements DelegatingModuleParser {
|
|||
List<Conflict> conflicts = null;
|
||||
|
||||
final List<Element> conflictsContent = syncElement.getContent(new ContentFilter(Conflicts.NAME));
|
||||
for (final Iterator<Element> conflictsIter = conflictsContent.iterator(); conflictsIter.hasNext();) {
|
||||
final Element conflictsElement = conflictsIter.next();
|
||||
|
||||
for (final Element conflictsElement : conflictsContent) {
|
||||
final List<Element> conflictContent = conflictsElement.getContent(new ContentFilter(Conflict.NAME));
|
||||
for (final Iterator<Element> conflictIter = conflictContent.iterator(); conflictIter.hasNext();) {
|
||||
final Element conflictElement = (Element) conflictIter.next();
|
||||
for (final Element element : conflictContent) {
|
||||
final Element conflictElement = element;
|
||||
|
||||
final Conflict conflict = new Conflict();
|
||||
conflict.setBy(parseStringAttribute(conflictElement, Conflict.BY_ATTRIBUTE));
|
||||
|
@ -132,8 +129,8 @@ public class SSE091Parser implements DelegatingModuleParser {
|
|||
conflict.setVersion(parseIntegerAttribute(conflictElement, Conflict.VERSION_ATTRIBUTE));
|
||||
|
||||
final List<Element> conflictItemContent = conflictElement.getContent(new ContentFilter("item"));
|
||||
for (final Iterator<Element> conflictItemIter = conflictItemContent.iterator(); conflictItemIter.hasNext();) {
|
||||
final Element conflictItemElement = (Element) conflictItemIter.next();
|
||||
for (final Element element2 : conflictItemContent) {
|
||||
final Element conflictItemElement = element2;
|
||||
final Element root = getRoot(conflictItemElement);
|
||||
final Item conflictItem = rssParser.parseItem(root, conflictItemElement, locale);
|
||||
conflict.setItem(conflictItem);
|
||||
|
@ -176,15 +173,14 @@ public class SSE091Parser implements DelegatingModuleParser {
|
|||
final List<Element> filterList = element.getContent(new ContentFilter(name));
|
||||
Element firstContent = null;
|
||||
if (filterList != null && filterList.size() > 0) {
|
||||
firstContent = (Element) filterList.get(0);
|
||||
firstContent = filterList.get(0);
|
||||
}
|
||||
return firstContent;
|
||||
}
|
||||
|
||||
private void parseUpdates(final Element historyChild, final History history, final Locale locale) {
|
||||
final List<Element> updatedChildren = historyChild.getContent(new ContentFilter(Update.NAME));
|
||||
for (final Iterator<Element> childIter = updatedChildren.iterator(); childIter.hasNext();) {
|
||||
final Element updateChild = childIter.next();
|
||||
for (final Element updateChild : updatedChildren) {
|
||||
final Update update = new Update();
|
||||
update.setBy(parseStringAttribute(updateChild, Update.BY_ATTRIBUTE));
|
||||
update.setWhen(parseDateAttribute(updateChild, Update.WHEN_ATTRIBUTE, locale));
|
||||
|
|
|
@ -144,7 +144,7 @@ public class WeatherModuleParser implements ModuleParser {
|
|||
try {
|
||||
final Condition c = new Condition(condition.getAttributeValue("text"), ConditionCode.fromCode(Integer.parseInt(condition
|
||||
.getAttributeValue("code"))), Integer.parseInt(condition.getAttributeValue("temp")), LONG_DATE.parse(condition
|
||||
.getAttributeValue("date").replaceAll("pm", "PM").replaceAll("am", "AM")));
|
||||
.getAttributeValue("date").replaceAll("pm", "PM").replaceAll("am", "AM")));
|
||||
module.setCondition(c);
|
||||
} catch (final NumberFormatException nfe) {
|
||||
Logger.getAnonymousLogger().warning("NumberFormatException processing <condition> tag.");
|
||||
|
|
|
@ -54,6 +54,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Astronomy implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final EqualsBean equals = new EqualsBean(Astronomy.class, this);
|
||||
private final ToStringBean toString = new ToStringBean(Astronomy.class, this);
|
||||
private Date sunrise;
|
||||
|
|
|
@ -57,6 +57,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Atmosphere implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final EqualsBean equals = new EqualsBean(Atmosphere.class, this);
|
||||
private final ToStringBean toString = new ToStringBean(Atmosphere.class, this);
|
||||
private int humidity;
|
||||
|
@ -180,6 +184,10 @@ public class Atmosphere implements Serializable, Cloneable {
|
|||
}
|
||||
|
||||
public static class PressureChange implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final PressureChange RISING = new PressureChange(1, "rising");
|
||||
public static final PressureChange STEADY = new PressureChange(0, "steady");
|
||||
public static final PressureChange FALLING = new PressureChange(2, "falling");
|
||||
|
@ -214,17 +222,17 @@ public class Atmosphere implements Serializable, Cloneable {
|
|||
*/
|
||||
public static PressureChange fromCode(final int code) {
|
||||
switch (code) {
|
||||
case 0:
|
||||
return STEADY;
|
||||
case 0:
|
||||
return STEADY;
|
||||
|
||||
case 1:
|
||||
return RISING;
|
||||
case 1:
|
||||
return RISING;
|
||||
|
||||
case 2:
|
||||
return FALLING;
|
||||
case 2:
|
||||
return FALLING;
|
||||
|
||||
default:
|
||||
throw new RuntimeException("Invalid pressure change code.");
|
||||
default:
|
||||
throw new RuntimeException("Invalid pressure change code.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Condition implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final EqualsBean equals = new EqualsBean(Condition.class, this);
|
||||
private final ToStringBean toString = new ToStringBean(Condition.class, this);
|
||||
private String text;
|
||||
|
|
|
@ -286,6 +286,10 @@ import com.sun.syndication.feed.impl.EqualsBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class ConditionCode implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient static Map LOOKUP = new HashMap(); /* <Integer, Condition> */
|
||||
public static final ConditionCode TORNADO = new ConditionCode(0, "tornado");
|
||||
public static final ConditionCode TROPICAL_STORM = new ConditionCode(1, "tropical storm");
|
||||
|
|
|
@ -61,6 +61,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Forecast implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient ToStringBean toString = new ToStringBean(Forecast.class, this);
|
||||
private transient EqualsBean equals = new EqualsBean(Forecast.class, this);
|
||||
private String day;
|
||||
|
|
|
@ -54,6 +54,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Location implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient ToStringBean toString = new ToStringBean(Location.class, this);
|
||||
private transient EqualsBean equals = new EqualsBean(Location.class, this);
|
||||
private String city;
|
||||
|
|
|
@ -59,6 +59,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Units implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient ToStringBean toString = new ToStringBean(Units.class, this);
|
||||
private transient EqualsBean equals = new EqualsBean(Units.class, this);
|
||||
private String temperature;
|
||||
|
|
|
@ -58,6 +58,10 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
public class Wind implements Serializable, Cloneable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private transient ToStringBean toString = new ToStringBean(Wind.class, this);
|
||||
private transient EqualsBean equals = new EqualsBean(Wind.class, this);
|
||||
private int chill;
|
||||
|
|
|
@ -72,51 +72,21 @@ public class MediaModuleTest extends AbstractTestCase {
|
|||
public void xtestOriginal() throws Exception {
|
||||
//
|
||||
/*
|
||||
* //You can test with blip tv or broadcast machine
|
||||
*
|
||||
* String rss = "http://blip.tv/?1=1&&skin=rss";// // String rss = "http://openvision.tv/bm/rss.php?i=4"; // String rss =
|
||||
* "http://api.search.yahoo.com/VideoSearchService/rss/videoSearch.xml?appid=yahoosearchvideorss&query=surfing&adult_ok=0";
|
||||
*
|
||||
*
|
||||
* URLConnection uc = new URL(rss).openConnection(); String contentType = uc.getContentEncoding();
|
||||
*
|
||||
* WireFeedInput input = new WireFeedInput();
|
||||
*
|
||||
* XmlReader xmlReader = new XmlReader(uc.getInputStream(), contentType, true);
|
||||
*
|
||||
* Channel chnl = (Channel)input.build(xmlReader);
|
||||
*
|
||||
* String feedTitle = chnl.getTitle(); String feedDesc = chnl.getDescription();
|
||||
*
|
||||
*
|
||||
* List items = chnl.getItems();
|
||||
*
|
||||
* ListIterator li = items.listIterator(); Item item = null; Enclosure enc = null; MediaModule mModule = null;
|
||||
*
|
||||
* while (li.hasNext()) {
|
||||
*
|
||||
* item = (Item)li.next(); enc = (Enclosure)item.getEnclosures().get(0);
|
||||
*
|
||||
* mModule = (MediaModule)item.getModule(MediaModule.URI);
|
||||
*
|
||||
* List modules = item.getModules(); System.out.println("title: " + item.getTitle()); System.out.println("module count: " + modules.size());
|
||||
*
|
||||
* if (mModule != null) { Thumbnail[] mThumbs = mModule.getMediaThumbnails();
|
||||
*
|
||||
* if (mThumbs != null) { for (int i = 0; i < mThumbs.length; i++) { String imgUrl = mThumbs[i].getUrl(); System.out.println("got MediaModule img " + i
|
||||
* + ": " + imgUrl); } }
|
||||
*
|
||||
* System.out.println("MediaModule title: " + mModule.getTitle()); System.out.println("MediaModule isAdult: " + mModule.isAdult()); /* if
|
||||
* //You can test with blip tv or broadcast machine String rss = "http://blip.tv/?1=1&&skin=rss";// // String rss =
|
||||
* "http://openvision.tv/bm/rss.php?i=4"; // String rss =
|
||||
* "http://api.search.yahoo.com/VideoSearchService/rss/videoSearch.xml?appid=yahoosearchvideorss&query=surfing&adult_ok=0"; URLConnection uc = new
|
||||
* URL(rss).openConnection(); String contentType = uc.getContentEncoding(); WireFeedInput input = new WireFeedInput(); XmlReader xmlReader = new
|
||||
* XmlReader(uc.getInputStream(), contentType, true); Channel chnl = (Channel)input.build(xmlReader); String feedTitle = chnl.getTitle(); String
|
||||
* feedDesc = chnl.getDescription(); List items = chnl.getItems(); ListIterator li = items.listIterator(); Item item = null; Enclosure enc = null;
|
||||
* MediaModule mModule = null; while (li.hasNext()) { item = (Item)li.next(); enc = (Enclosure)item.getEnclosures().get(0); mModule =
|
||||
* (MediaModule)item.getModule(MediaModule.URI); List modules = item.getModules(); System.out.println("title: " + item.getTitle());
|
||||
* System.out.println("module count: " + modules.size()); if (mModule != null) { Thumbnail[] mThumbs = mModule.getMediaThumbnails(); if (mThumbs !=
|
||||
* null) { for (int i = 0; i < mThumbs.length; i++) { String imgUrl = mThumbs[i].getUrl(); System.out.println("got MediaModule img " + i + ": " +
|
||||
* imgUrl); } } System.out.println("MediaModule title: " + mModule.getTitle()); System.out.println("MediaModule isAdult: " + mModule.isAdult()); /* if
|
||||
* (mModule.getMediaContent() != null) { for (int i = 0; i < mModule.getMediaContent().length; i++) { MediaContent mc = mModule.getMediaContent()[i];
|
||||
* mThumbs = mc.getMediaThumbnails(); if (mThumbs != null) { for (int n = 0; n < mThumbs.length; n++) { String imgUrl = mThumbs[n].getUrl();
|
||||
* System.out.println("got MediaContentImage " + n + " img: " + imgUrl); } } System.out.println("MediaContent title:" + mc.getTitle());
|
||||
* System.out.println("MediaContent text:" + mc.getText());
|
||||
*
|
||||
* }
|
||||
*
|
||||
* }
|
||||
*
|
||||
* } else { System.out.println("no MediaModule!"); } }
|
||||
* System.out.println("MediaContent text:" + mc.getText()); } } } else { System.out.println("no MediaModule!"); } }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.rometools.feed.module.cc.types;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Matthew Buckett
|
||||
|
@ -29,37 +29,35 @@ public class LicenseTest {
|
|||
final AtomicBoolean hadException = new AtomicBoolean(false);
|
||||
|
||||
// This thread keeps on adding new licenses (not very realistic but shows the bug)
|
||||
Thread addNew = new Thread(){
|
||||
final Thread addNew = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
while(run.get()) {
|
||||
License license = License.findByValue("http://creativecommons.org/licenses/"+
|
||||
type.incrementAndGet()+ "/1");
|
||||
while (run.get()) {
|
||||
final License license = License.findByValue("http://creativecommons.org/licenses/" + type.incrementAndGet() + "/1");
|
||||
if (license == null) {
|
||||
hadProblem.set(true);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
hadException.set(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// This thread attempts to get ones we know have already been put in.
|
||||
Thread getExisting = new Thread() {
|
||||
final Thread getExisting = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Random rnd = new Random();
|
||||
final Random rnd = new Random();
|
||||
try {
|
||||
while(run.get()) {
|
||||
License license = License.findByValue("http://creativecommons.org/licenses/"+
|
||||
rnd.nextInt(type.intValue())+"/1");
|
||||
while (run.get()) {
|
||||
final License license = License.findByValue("http://creativecommons.org/licenses/" + rnd.nextInt(type.intValue()) + "/1");
|
||||
if (license == null) {
|
||||
hadProblem.set(true);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
hadException.set(true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue