Commit cf0ca34f authored by Liang Ding's avatar Liang Ding

重构 - 格式化代码

parent 209a8b22
...@@ -15,20 +15,17 @@ ...@@ -15,20 +15,17 @@
*/ */
package org.b3log.solo.model.feed.atom; package org.b3log.solo.model.feed.atom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.TimeZone; import java.util.TimeZone;
import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateFormatUtils;
/** /**
* Feed. * Feed.
* *
* <p> * <p>
* See <a href="http://tools.ietf.org/html/rfc4287">RFC 4278</a> for more * See <a href="http://tools.ietf.org/html/rfc4287">RFC 4278</a> for more details.
* details.
* </p> * </p>
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
...@@ -72,7 +69,7 @@ public final class Feed { ...@@ -72,7 +69,7 @@ public final class Feed {
/** /**
* Entries. * Entries.
*/ */
private List<Entry> entries = new ArrayList<Entry>(); private List<Entry> entries = new ArrayList<>();
/** /**
* Link variable. * Link variable.
...@@ -166,7 +163,7 @@ public final class Feed { ...@@ -166,7 +163,7 @@ public final class Feed {
/** /**
* Gets the id. * Gets the id.
* *
* @return id * @return id
*/ */
public String getId() { public String getId() {
...@@ -175,7 +172,7 @@ public final class Feed { ...@@ -175,7 +172,7 @@ public final class Feed {
/** /**
* Sets the id with the specified id. * Sets the id with the specified id.
* *
* @param id the specified id * @param id the specified id
*/ */
public void setId(final String id) { public void setId(final String id) {
...@@ -302,7 +299,7 @@ public final class Feed { ...@@ -302,7 +299,7 @@ public final class Feed {
stringBuilder.append(START_UPDATED_ELEMENT); stringBuilder.append(START_UPDATED_ELEMENT);
stringBuilder.append(DateFormatUtils.format(// using ISO-8601 instead of RFC-3339 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(END_UPDATED_ELEMENT);
stringBuilder.append(START_AUTHOR_ELEMENT); stringBuilder.append(START_AUTHOR_ELEMENT);
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package org.b3log.solo.model.feed.rss; package org.b3log.solo.model.feed.rss;
/** /**
* Category. * Category.
* *
......
...@@ -15,23 +15,21 @@ ...@@ -15,23 +15,21 @@
*/ */
package org.b3log.solo.model.feed.rss; package org.b3log.solo.model.feed.rss;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateFormatUtils;
/** /**
* RSS 2.0 channel. * RSS 2.0 channel.
* *
* <p> * <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. * for more details.
* </p> * </p>
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @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 Item
* @see Category * @see Category
* @since 0.3.1 * @since 0.3.1
...@@ -76,7 +74,7 @@ public final class Channel { ...@@ -76,7 +74,7 @@ public final class Channel {
/** /**
* Items. * Items.
*/ */
private List<Item> items = new ArrayList<Item>(); private List<Item> items = new ArrayList<>();
/** /**
* Time zone id. * Time zone id.
...@@ -86,8 +84,8 @@ public final class Channel { ...@@ -86,8 +84,8 @@ public final class Channel {
/** /**
* Start. * Start.
*/ */
private static final String START = "<?xml version='1.0' encoding='UTF-8'?><rss version=\"2.0\" " 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>"; + "xmlns:atom=\"http://www.w3.org/2005/Atom\"><channel>";
/** /**
* End. * End.
...@@ -123,7 +121,7 @@ public final class Channel { ...@@ -123,7 +121,7 @@ public final class Channel {
* Atom link element. * Atom link element.
*/ */
private static final String ATOM_LINK_ELEMENT = "<atom:link href=\"" + ATOM_LINK_VARIABLE 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. * Start description element.
...@@ -161,13 +159,13 @@ public final class Channel { ...@@ -161,13 +159,13 @@ public final class Channel {
private static final String START_LAST_BUILD_DATE_ELEMENT = "<lastBuildDate>"; 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>"; private static final String END_LAST_BUILD_DATE_ELEMENT = "</lastBuildDate>";
/** /**
* Sets the atom link with the specified atom link. * Sets the atom link with the specified atom link.
* *
* @param atomLink the specified atom link * @param atomLink the specified atom link
*/ */
public void setAtomLink(final String atomLink) { public void setAtomLink(final String atomLink) {
...@@ -176,7 +174,7 @@ public final class Channel { ...@@ -176,7 +174,7 @@ public final class Channel {
/** /**
* Gets the atom link. * Gets the atom link.
* *
* @return atom link * @return atom link
*/ */
public String getAtomLink() { public String getAtomLink() {
...@@ -185,7 +183,7 @@ public final class Channel { ...@@ -185,7 +183,7 @@ public final class Channel {
/** /**
* Gets the last build date. * Gets the last build date.
* *
* @return last build date * @return last build date
*/ */
public Date getLastBuildDate() { public Date getLastBuildDate() {
...@@ -194,7 +192,7 @@ public final class Channel { ...@@ -194,7 +192,7 @@ public final class Channel {
/** /**
* Sets the last build date with the specified last build date. * Sets the last build date with the specified last build date.
* *
* @param lastBuildDate the specified last build date * @param lastBuildDate the specified last build date
*/ */
public void setLastBuildDate(final Date lastBuildDate) { public void setLastBuildDate(final Date lastBuildDate) {
...@@ -203,7 +201,7 @@ public final class Channel { ...@@ -203,7 +201,7 @@ public final class Channel {
/** /**
* Gets generator. * Gets generator.
* *
* @return generator * @return generator
*/ */
public String getGenerator() { public String getGenerator() {
...@@ -212,7 +210,7 @@ public final class Channel { ...@@ -212,7 +210,7 @@ public final class Channel {
/** /**
* Sets the generator with the specified generator. * Sets the generator with the specified generator.
* *
* @param generator the specified generator * @param generator the specified generator
*/ */
public void setGenerator(final String generator) { public void setGenerator(final String generator) {
......
...@@ -15,14 +15,12 @@ ...@@ -15,14 +15,12 @@
*/ */
package org.b3log.solo.model.feed.rss; package org.b3log.solo.model.feed.rss;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateFormatUtils;
/** /**
* Item. * Item.
* *
...@@ -75,7 +73,7 @@ public final class Item { ...@@ -75,7 +73,7 @@ public final class Item {
/** /**
* Categories. * Categories.
*/ */
private Set<Category> categories = new HashSet<Category>(); private Set<Category> categories = new HashSet<>();
/** /**
* Start guid element. * Start guid element.
...@@ -129,7 +127,7 @@ public final class Item { ...@@ -129,7 +127,7 @@ public final class Item {
/** /**
* Gets the GUID. * Gets the GUID.
* *
* @return GUID * @return GUID
*/ */
public String getGUID() { public String getGUID() {
...@@ -138,7 +136,7 @@ public final class Item { ...@@ -138,7 +136,7 @@ public final class Item {
/** /**
* Sets the GUID with the specified GUID. * Sets the GUID with the specified GUID.
* *
* @param guid the specified GUID * @param guid the specified GUID
*/ */
public void setGUID(final String 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