java.lang.Objectorg.mozilla.javascript.ScriptableObject
org.wso2.mashup.hostobjects.feed.FeedReader
public class FeedReader
The FeedReader is a generic reader of Atom and RSS feeds.
| Field Summary |
|---|
| Fields inherited from class org.mozilla.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY,
UNINITIALIZED_CONST |
| Fields inherited from interface org.mozilla.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
FeedReader() |
|
| Method Summary | |
|---|---|
java.lang.String |
getClassName() |
void |
jsConstructor() |
static Feed |
jsFunction_get(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)Reads a RSS/Atom feed from a given url eg: var reader = new FeedReader(); var feed = new Feed(); feed = reader.get("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml"); or feed = reader.get("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml", "username", "password"); |
| Methods inherited from class org.mozilla.javascript.ScriptableObject |
|---|
associateValue, callMethod, callMethod, defineClass,
defineClass, defineClass, defineConst, defineConstProperty,
defineFunctionProperties, defineProperty, defineProperty,
defineProperty, defineProperty, delete, delete, deleteProperty,
deleteProperty, get, get, getAllIds, getAssociatedValue,
getAttributes, getAttributes, getAttributes, getAttributes,
getClassPrototype, getDefaultValue, getDefaultValue,
getFunctionPrototype, getGetterOrSetter, getIds,
getObjectPrototype, getParentScope, getProperty, getProperty,
getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue,
has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed,
put, put, putConst, putConstProperty, putProperty, putProperty,
redefineProperty, sealObject, setAttributes, setAttributes,
setAttributes, setAttributes, setGetterOrSetter, setParentScope,
setPrototype |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString,
wait, wait, wait |
| Constructor Detail |
|---|
public FeedReader()
| Method Detail |
|---|
public void jsConstructor()
public java.lang.String getClassName()
getClassName in interface
org.mozilla.javascript.ScriptablegetClassName in class
org.mozilla.javascript.ScriptableObject
public static Feed jsFunction_get(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
java.lang.Object[] arguments,
org.mozilla.javascript.Function funObj)
throws org.wso2.mashup.MashupFault
eg:
var reader = new FeedReader();
var feed = new Feed();
feed = reader.get("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml");
or
feed = reader.get("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml", "username", "password");
cx - Provides the current contextthisObj - Gives an instance of the js object from
which this method was calledarguments - The expected argument is a String
representing the URL of the feed. Optionally a username and a
password can be provided for basic authneticaiton.funObj -java.io.IOExceptionorg.wso2.mashup.MashupFault