|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nava.informa.impl.basic.Channel
public class Channel
In-Memory implementation of the ChannelIF interface.
Constructor Summary | |
---|---|
Channel()
|
|
Channel(org.jdom.Element channelElement)
|
|
Channel(org.jdom.Element channelElement,
String title)
|
|
Channel(String title)
|
Method Summary | |
---|---|
void |
addCategory(CategoryIF category)
|
void |
addItem(ItemIF item)
|
void |
addObserver(ChannelObserverIF o)
Adds an observer to the set of observers for this object. |
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one. |
String |
getAttributeValue(String path,
String attribute)
Returns the value of the attribute of the Channel's child element reached by the given path. |
String[] |
getAttributeValues(String path,
String[] attributes)
Returns the values of the specified attributes of the Channel's child element reached by the given path. |
Collection |
getCategories()
Gets the assigned category objects for this channel. |
CloudIF |
getCloud()
|
String |
getCopyright()
|
String |
getCreator()
|
String |
getDescription()
|
String |
getDocs()
|
String |
getElementValue(String path)
Returns the value of the Channel's child element reached by the given path. |
String[] |
getElementValues(String path,
String[] elements)
Returns the values of the specified sub-elements of the Channel's child reached by the given path. |
ChannelFormat |
getFormat()
Gets the syntax format used by the channel. |
String |
getGenerator()
|
long |
getId()
|
ImageIF |
getImage()
Retrieves the Image associated with this feed. |
ItemIF |
getItem(long anId)
Returns the news item as specified by the item identifier ( WithIdMIF.getId() ). |
Set<ItemIF> |
getItems()
|
String |
getLanguage()
|
Date |
getLastBuildDate()
|
Date |
getLastUpdated()
Returns that date and time at which the feed was parsed and the channel object was updated (or created) from feed XML content |
URL |
getLocation()
|
Date |
getPubDate()
|
String |
getPublisher()
|
String |
getRating()
|
URL |
getSite()
|
TextInputIF |
getTextInput()
|
String |
getTitle()
|
int |
getTtl()
|
Date |
getUpdateBase()
Accesses data provided by the Syndication module (will apply only to RSS 1.0+). |
int |
getUpdateFrequency()
Accesses data provided by the Syndication module (will apply only to RSS 1.0+). |
ChannelUpdatePeriod |
getUpdatePeriod()
Accesses data provided by the Syndication module (will apply only to RSS 1.0+). |
int |
hashCode()
Returns a hash code value for the object. |
void |
removeCategory(CategoryIF category)
|
void |
removeItem(ItemIF item)
|
void |
removeObserver(ChannelObserverIF o)
Removes an observer from the set of observers of this object. |
void |
setAllProperties(ChannelIF sourceChan)
setAllProperties - Set all the properties in this Channel by copying them from a source Channel. |
void |
setCategories(Collection<CategoryIF> categories)
|
void |
setCloud(CloudIF cloud)
|
void |
setCopyright(String copyright)
|
void |
setCreator(String creator)
|
void |
setDescription(String description)
|
void |
setDocs(String docs)
|
void |
setFormat(ChannelFormat format)
|
void |
setGenerator(String generator)
|
void |
setId(long id)
|
void |
setImage(ImageIF image)
Sets the image for this feed |
void |
setLanguage(String language)
|
void |
setLastBuildDate(Date date)
|
void |
setLastUpdated(Date lastUpdated)
see ChannelIF.getLastUpdated() |
void |
setLocation(URL location)
|
void |
setPubDate(Date pubDate)
|
void |
setPublisher(String publisher)
|
void |
setRating(String rating)
|
void |
setSite(URL site)
|
void |
setTextInput(TextInputIF textInput)
|
void |
setTitle(String title)
|
void |
setTtl(int ttl)
|
void |
setUpdateBase(Date updateBase)
Sets the base time against which update times should be calculated |
void |
setUpdateFrequency(int updateFrequency)
Sets the number of times during updatePeriod that the feed
should be updated |
void |
setUpdatePeriod(ChannelUpdatePeriod updatePeriod)
Sets the update frequency for the feed. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Channel()
public Channel(String title)
public Channel(org.jdom.Element channelElement)
public Channel(org.jdom.Element channelElement, String title)
Method Detail |
---|
public long getId()
getId
in interface WithIdMIF
public void setId(long id)
setId
in interface WithIdMIF
id
- the identifier of the object to be set.public String getTitle()
getTitle
in interface WithTitleMIF
public void setTitle(String title)
setTitle
in interface WithTitleMIF
title
- the title of the object to be setpublic String getDescription()
getDescription
in interface WithDescriptionMIF
public void setDescription(String description)
setDescription
in interface WithDescriptionMIF
description
- the description of the object to be setpublic URL getLocation()
getLocation
in interface WithLocationMIF
public void setLocation(URL location)
setLocation
in interface WithLocationMIF
location
- The URL where this channel can be retrieved from.public URL getSite()
getSite
in interface WithSiteMIF
public void setSite(URL site)
setSite
in interface WithSiteMIF
site
- the link to the site to be setpublic String getCreator()
getCreator
in interface WithCreatorMIF
null
if nothing
appropriate found.
For RSS 0.91 and 2.0 feeds: return text under managingEditor element For
RSS 1.0 feed: first checks if creator element exists as dublin core
metadata, and then falls back to managingEditor element For RSS 2.0
entries: checks the author element for each entry or fallback to creator
metadata element from dublin core
For Atom 0.3 and 1.0 feeds: checks author element. For Atom 1.0, multiple
authors are possible, in which case we return a list of authors delimited
by semicolon. Note that the author name itself may contain a semicolon, in
which case seperation of author names by splitting at every semicolon will
not work.public void setCreator(String creator)
setCreator
in interface WithCreatorMIF
creator
- the creator of the object to be setpublic String getPublisher()
getPublisher
in interface ChannelIF
public void setPublisher(String publisher)
setPublisher
in interface ChannelIF
public String getLanguage()
getLanguage
in interface ChannelIF
public void setLanguage(String language)
setLanguage
in interface ChannelIF
public String getRating()
getRating
in interface ChannelIF
public void setRating(String rating)
setRating
in interface ChannelIF
public CloudIF getCloud()
getCloud
in interface ChannelIF
public void setCloud(CloudIF cloud)
setCloud
in interface ChannelIF
public String getGenerator()
getGenerator
in interface ChannelIF
public void setGenerator(String generator)
setGenerator
in interface ChannelIF
public String getDocs()
getDocs
in interface ChannelIF
public void setDocs(String docs)
setDocs
in interface ChannelIF
public int getTtl()
getTtl
in interface ChannelIF
public void setTtl(int ttl)
setTtl
in interface ChannelIF
public ChannelFormat getFormat()
ChannelIF
getFormat
in interface ChannelIF
ChannelFormat
.public void setFormat(ChannelFormat format)
setFormat
in interface ChannelIF
public Set<ItemIF> getItems()
getItems
in interface ChannelIF
ItemIF
objects.public void addItem(ItemIF item)
addItem
in interface ChannelIF
public void removeItem(ItemIF item)
removeItem
in interface ChannelIF
public ItemIF getItem(long anId)
ChannelIF
WithIdMIF.getId()
).
getItem
in interface ChannelIF
anId
- the Item's id.
public ImageIF getImage()
ChannelIF
getImage
in interface ChannelIF
public void setImage(ImageIF image)
ChannelIF
setImage
in interface ChannelIF
image
- The imagepublic TextInputIF getTextInput()
getTextInput
in interface ChannelIF
public void setTextInput(TextInputIF textInput)
setTextInput
in interface ChannelIF
public String getCopyright()
getCopyright
in interface WithSiteMIF
public void setCopyright(String copyright)
setCopyright
in interface WithSiteMIF
copyright
- the copyright information to be setpublic Collection getCategories()
WithCategoriesMIF
getCategories
in interface WithCategoriesMIF
public void setCategories(Collection<CategoryIF> categories)
setCategories
in interface WithCategoriesMIF
public void addCategory(CategoryIF category)
addCategory
in interface WithCategoriesMIF
public void removeCategory(CategoryIF category)
removeCategory
in interface WithCategoriesMIF
public Date getLastUpdated()
ChannelIF
getLastUpdated
in interface ChannelIF
public void setLastUpdated(Date lastUpdated)
ChannelIF
ChannelIF.getLastUpdated()
setLastUpdated
in interface ChannelIF
public Date getLastBuildDate()
getLastBuildDate
in interface ChannelIF
public void setLastBuildDate(Date date)
setLastBuildDate
in interface ChannelIF
public Date getPubDate()
getPubDate
in interface ChannelIF
public void setPubDate(Date pubDate)
setPubDate
in interface ChannelIF
public void setAllProperties(ChannelIF sourceChan)
sourceChan
- - ChannelIF that will supply new valuespublic ChannelUpdatePeriod getUpdatePeriod()
ChannelIF
getUpdatePeriod
in interface ChannelIF
public void setUpdatePeriod(ChannelUpdatePeriod updatePeriod)
ChannelIF
updateFrequency
should be one of:
setUpdatePeriod
in interface ChannelIF
updatePeriod
- See abovepublic int getUpdateFrequency()
ChannelIF
updatePeriod
that a feed should be updated
getUpdateFrequency
in interface ChannelIF
updatePeriod
to update the
feedChannelIF.setUpdatePeriod(de.nava.informa.core.ChannelUpdatePeriod)
,
ChannelIF.getUpdatePeriod()
public void setUpdateFrequency(int updateFrequency)
ChannelIF
updatePeriod
that the feed
should be updated
setUpdateFrequency
in interface ChannelIF
updateFrequency
- number of times during updatePeriod
to
update the feedpublic Date getUpdateBase()
ChannelIF
getUpdateBase
in interface ChannelIF
public void setUpdateBase(Date updateBase)
ChannelIF
setUpdateBase
in interface ChannelIF
updateBase
- The base date for updatespublic String getElementValue(String path)
WithElementsAndAttributesMIF
getElementValue
in interface WithElementsAndAttributesMIF
path
- a path to the child. Paths are specified as element names, separated by a "/".
Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".
null
if path is null
.public String[] getElementValues(String path, String[] elements)
WithElementsAndAttributesMIF
getElementValues
in interface WithElementsAndAttributesMIF
path
- a path to the child. Paths are specified as element names, separated by a "/".
Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".elements
- An array of element names. May contain namespace specifiers.
path
is null
, returns the specified sub-elements for the Channel.
If elements
is null
, returns null
.public String getAttributeValue(String path, String attribute)
WithElementsAndAttributesMIF
getAttributeValue
in interface WithElementsAndAttributesMIF
path
- a path to the root of the elements. Paths are specified as element names, separated by a "/".attribute
- the attribute. May contain a namespace specifier e.g. "rdf:resource".
path
is null
, returns the specified attribute for the Channel.
If attribute
is null
, returns null
.public String[] getAttributeValues(String path, String[] attributes)
WithElementsAndAttributesMIF
getAttributeValues
in interface WithElementsAndAttributesMIF
path
- a path to the child. Paths are specified as element names, separated by a "/".
Namespaces are allowed. e.g. "aaa:bbb/ccc:ddd/eee".attributes
- An array of element names. May contain namespace specifiers.
path
is null
, returns the specified attributes for the Channel.
If attributes
is null
, returns null
.public void addObserver(ChannelObserverIF o)
ChannelObservableIF
addObserver
in interface ChannelObservableIF
public void removeObserver(ChannelObserverIF o)
ChannelObservableIF
removeObserver
in interface ChannelObservableIF
public boolean equals(Object o)
equals
in class Object
o
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.hashCode()
public int hashCode()
java.util.Hashtable
.
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |