📄 image.java
字号:
package cn.pfc.ywt.writer;
/**
* <p>
* Name: Image.java
*
* <p>
* Title: 与频道一起显示的图片地址
*
* <p>
* Description: <image>是一个可选的<channel>子节点,该节点包含三个必需的子元素和三个可选的子元素。
*
* <p>
* Copyright: Copyright (c) 2007
*
* <p>
* Company: 北大方正软件技术学院实训基地
*
* <p>
* Modified: 2007年12月22日
*
* @author 杨文通
* @version 1.0
*/
public class Image extends RssElement {
// 必选,是GIF、JPEG或PNG图像文件的URL地址,该图像代表整个频道
private String url;
// 必选,用于描述上面的图像,等同于HTML语言中的<img>的alt属性
private String title;
// 必选,是要连接的站点的url,当显示频道时,图像的连接指向该站点。
private String link;
// 可选,就是link的TITLE属性中文本,它将在调用网页时显示出来。
private String description;
// 可选,图像宽度的最大值为144,默认值为88
private int width = 88;
// 可选,图像高度的最大值为400,默认值为31
private int height = 31;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public Image(String url, String title, String link) {
super();
this.url = url;
this.title = title;
this.link = link;
}
public Image(String url, String title, String link, String description,
int width, int height) {
super();
this.url = url;
this.title = title;
this.link = link;
this.description = description;
this.width = width;
this.height = height;
}
public Image() {
super();
}
@Override
public String toString() {
StringBuilder str = new StringBuilder(32);
str.append("<image>");
str.append("<url>" + strNotNull(this.url) + "</url>");
str.append("<title><![CDATA[" + strNotNull(this.title) + "]]></title>");
str.append("<link>" + strNotNull(this.link) + "</link>");
if (strNotNull(this.description).length() > 0) {
str.append("<description><![CDATA[" + this.description
+ "]]></description>");
}
if (this.width > 0) {
str.append("<width>" + this.width + "</width>");
}
if (this.height > 0) {
str.append("<height>" + this.height + "</height>");
}
str.append("</image>");
return str.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -