Package com.oorian.rss
Class RssImage
java.lang.Object
com.oorian.rss.RssImage
Represents an RSS channel
<image> element for the channel logo.
The image element specifies a GIF, JPEG, or PNG image that can be displayed with the channel. The url, title, and link sub-elements are required. Width and height are optional (defaults: 88 and 31, maximum: 144 and 400 respectively per RSS 2.0 spec).
Usage:
RssImage image = new RssImage(
"https://example.com/logo.png",
"My Blog",
"https://example.com"
);
image.setWidth(144).setHeight(100);
- Since:
- 0.1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLink()getTitle()getUrl()intgetWidth()setDescription(String description) Sets an optional text description of the image.setHeight(int height) Sets the height of the image in pixels (maximum 400).setWidth(int width) Sets the width of the image in pixels (maximum 144).com.oorian.xml.XmlElementConverts this image to anXmlElement.
-
Constructor Details
-
RssImage
Creates an image with the required url, title, and link.- Parameters:
url- The URL of the image file (GIF, JPEG, or PNG).title- The alt text for the image, typically matching the channel title.link- The URL of the site; the image links to this when rendered.
-
-
Method Details
-
setWidth
Sets the width of the image in pixels (maximum 144).- Parameters:
width- The image width in pixels.- Returns:
- This image for method chaining.
-
setHeight
Sets the height of the image in pixels (maximum 400).- Parameters:
height- The image height in pixels.- Returns:
- This image for method chaining.
-
setDescription
Sets an optional text description of the image.- Parameters:
description- The image description.- Returns:
- This image for method chaining.
-
getUrl
-
getTitle
-
getLink
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getDescription
-
toXmlElement
public com.oorian.xml.XmlElement toXmlElement()Converts this image to anXmlElement.- Returns:
- An XmlElement representing this
<image>element with its sub-elements.
-