Commit cf0ca34f authored by Liang Ding's avatar Liang Ding

重构 - 格式化代码

parent 209a8b22
......@@ -15,20 +15,17 @@
*/
package org.b3log.solo.model.feed.atom;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import org.apache.commons.lang.time.DateFormatUtils;
/**
* Feed.
*
* <p>
* See <a href="http://tools.ietf.org/html/rfc4287">RFC 4278</a> for more
* details.
* See <a href="http://tools.ietf.org/html/rfc4287">RFC 4278</a> for more details.
* </p>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
......@@ -72,7 +69,7 @@ public final class Feed {
/**
* Entries.
*/
private List<Entry> entries = new ArrayList<Entry>();
private List<Entry> entries = new ArrayList<>();
/**
* Link variable.
......@@ -166,7 +163,7 @@ public final class Feed {
/**
* Gets the id.
*
*
* @return id
*/
public String getId() {
......@@ -175,7 +172,7 @@ public final class Feed {
/**
* Sets the id with the specified id.
*
*
* @param id the specified id
*/
public void setId(final String id) {
......@@ -302,7 +299,7 @@ public final class Feed {
stringBuilder.append(START_UPDATED_ELEMENT);
stringBuilder.append(DateFormatUtils.format(// using ISO-8601 instead of RFC-3339
updated, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern(), TimeZone.getTimeZone(TIME_ZONE_ID)));
updated, DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT.getPattern(), TimeZone.getTimeZone(TIME_ZONE_ID)));
stringBuilder.append(END_UPDATED_ELEMENT);
stringBuilder.append(START_AUTHOR_ELEMENT);
......
......@@ -15,7 +15,6 @@
*/
package org.b3log.solo.model.feed.rss;
/**
* Category.
*
......
......@@ -15,23 +15,21 @@
*/
package org.b3log.solo.model.feed.rss;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.time.DateFormatUtils;
/**
* RSS 2.0 channel.
*
* <p>
* See <a href="http://cyber.law.harvard.edu/rss/rss.html">RSS 2.0 at Harvard Law</a>
* See <a href="http://cyber.law.harvard.edu/rss/rss.html">RSS 2.0 at Harvard Law</a>
* for more details.
* </p>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.1, Nov 19, 2011
* @version 1.1.0.2, Nov 4, 2016
* @see Item
* @see Category
* @since 0.3.1
......@@ -76,7 +74,7 @@ public final class Channel {
/**
* Items.
*/
private List<Item> items = new ArrayList<Item>();
private List<Item> items = new ArrayList<>();
/**
* Time zone id.
......@@ -86,8 +84,8 @@ public final class Channel {
/**
* Start.
*/
private static final String START = "<?xml version='1.0' encoding='UTF-8'?><rss version=\"2.0\" "
+ "xmlns:atom=\"http://www.w3.org/2005/Atom\"><channel>";
private static final String START = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\" "
+ "xmlns:atom=\"http://www.w3.org/2005/Atom\"><channel>";
/**
* End.
......@@ -123,7 +121,7 @@ public final class Channel {
* Atom link element.
*/
private static final String ATOM_LINK_ELEMENT = "<atom:link href=\"" + ATOM_LINK_VARIABLE
+ "\" rel=\"self\" type=\"application/rss+xml\" />";
+ "\" rel=\"self\" type=\"application/rss+xml\" />";
/**
* Start description element.
......@@ -161,13 +159,13 @@ public final class Channel {
private static final String START_LAST_BUILD_DATE_ELEMENT = "<lastBuildDate>";
/**
* End last build date element.
* End last build date element.
*/
private static final String END_LAST_BUILD_DATE_ELEMENT = "</lastBuildDate>";
/**
* Sets the atom link with the specified atom link.
*
*
* @param atomLink the specified atom link
*/
public void setAtomLink(final String atomLink) {
......@@ -176,7 +174,7 @@ public final class Channel {
/**
* Gets the atom link.
*
*
* @return atom link
*/
public String getAtomLink() {
......@@ -185,7 +183,7 @@ public final class Channel {
/**
* Gets the last build date.
*
*
* @return last build date
*/
public Date getLastBuildDate() {
......@@ -194,7 +192,7 @@ public final class Channel {
/**
* Sets the last build date with the specified last build date.
*
*
* @param lastBuildDate the specified last build date
*/
public void setLastBuildDate(final Date lastBuildDate) {
......@@ -203,7 +201,7 @@ public final class Channel {
/**
* Gets generator.
*
*
* @return generator
*/
public String getGenerator() {
......@@ -212,7 +210,7 @@ public final class Channel {
/**
* Sets the generator with the specified generator.
*
*
* @param generator the specified generator
*/
public void setGenerator(final String generator) {
......
......@@ -15,14 +15,12 @@
*/
package org.b3log.solo.model.feed.rss;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import org.apache.commons.lang.time.DateFormatUtils;
/**
* Item.
*
......@@ -75,7 +73,7 @@ public final class Item {
/**
* Categories.
*/
private Set<Category> categories = new HashSet<Category>();
private Set<Category> categories = new HashSet<>();
/**
* Start guid element.
......@@ -129,7 +127,7 @@ public final class Item {
/**
* Gets the GUID.
*
*
* @return GUID
*/
public String getGUID() {
......@@ -138,7 +136,7 @@ public final class Item {
/**
* Sets the GUID with the specified GUID.
*
*
* @param guid the specified GUID
*/
public void setGUID(final String guid) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment