org.apache.wink.common.model.rss
Class RssEnclosure

java.lang.Object
  extended by org.apache.wink.common.model.rss.RssEnclosure

public class RssEnclosure
extends Object

Java class for "enclosure" element of RSS 2.0 Specification.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="rssEnclosure">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <attribute name="url" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="length" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     </restriction>
   </complexContent>
 </complexType>
 
<enclosure> sub-element of <item>

<enclosure> is an optional sub-element of <item>.

It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type.

The url must be an http url.

<enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" />

A use-case narrative for this element is here.


Field Summary
protected  String length
           
protected  String type
           
protected  String url
           
 
Constructor Summary
RssEnclosure()
          Creates an RssEnclosure object
RssEnclosure(SyndLink syndLink)
          Creates an RssEnclosure object out of a SyndLink object.
 
Method Summary
 String getLength()
          Gets the value of the length property.
 String getType()
          Gets the value of the type property.
 String getUrl()
          Gets the value of the url property.
 void setLength(String value)
          Sets the value of the length property.
 void setType(String value)
          Sets the value of the type property.
 void setUrl(String value)
          Sets the value of the url property.
 SyndLink toSynd(SyndLink syndLink)
          Maps an RssEnclosure object into a SyndLink object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected String url

length

protected String length

type

protected String type
Constructor Detail

RssEnclosure

public RssEnclosure()
Creates an RssEnclosure object


RssEnclosure

public RssEnclosure(SyndLink syndLink)
Creates an RssEnclosure object out of a SyndLink object. Used for mapping Syndication Object Model into RSS.

Parameters:
syndLink - the SyndLink object which has to be mapped into an RssEnclosure object.
Method Detail

toSynd

public SyndLink toSynd(SyndLink syndLink)
Maps an RssEnclosure object into a SyndLink object. Used for mapping RSS into Syndication Object Model.

Parameters:
syndLink - the SyndLink object into which the given RssEnclosure object has to be mapped into
Returns:
the SyndLink object into which the given RssEnclosure object has been mapped into

getUrl

public String getUrl()
Gets the value of the url property.

Returns:
possible object is String

setUrl

public void setUrl(String value)
Sets the value of the url property.

Parameters:
value - allowed object is String

getLength

public String getLength()
Gets the value of the length property.

Returns:
possible object is String

setLength

public void setLength(String value)
Sets the value of the length property.

Parameters:
value - allowed object is String

getType

public String getType()
Gets the value of the type property.

Returns:
possible object is String

setType

public void setType(String value)
Sets the value of the type property.

Parameters:
value - allowed object is String


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.