From 0efd25e3aa839ba82da1054a470c27830b9ed94a Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 20 Jun 2017 13:57:27 +0200 Subject: [PATCH] Some jDoc fixes --- src/be/nikiroo/fanfix/Cache.java | 24 +++++++-------- src/be/nikiroo/fanfix/Main.java | 2 +- src/be/nikiroo/fanfix/VersionCheck.java | 6 ++++ .../nikiroo/fanfix/bundles/ConfigBundle.java | 3 ++ .../nikiroo/fanfix/bundles/package-info.java | 2 +- src/be/nikiroo/fanfix/data/Chapter.java | 2 +- src/be/nikiroo/fanfix/data/MetaData.java | 2 +- src/be/nikiroo/fanfix/data/Paragraph.java | 7 ++--- src/be/nikiroo/fanfix/output/BasicOutput.java | 20 ++++++++----- .../fanfix/supported/BasicSupport.java | 30 +++++++++++++++---- src/be/nikiroo/fanfix/supported/YiffStar.java | 1 + 11 files changed, 62 insertions(+), 37 deletions(-) diff --git a/src/be/nikiroo/fanfix/Cache.java b/src/be/nikiroo/fanfix/Cache.java index 7f603c1b..632c8441 100644 --- a/src/be/nikiroo/fanfix/Cache.java +++ b/src/be/nikiroo/fanfix/Cache.java @@ -14,7 +14,6 @@ import java.net.CookiePolicy; import java.net.CookieStore; import java.net.HttpCookie; import java.net.HttpURLConnection; -import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; @@ -303,17 +302,13 @@ public class Cache { } /** - * Open a resource (will load it from the cache if possible, or save it into - * the cache after downloading if not) as an Image, then save it where - * requested. - *

- * This version will not always work properly if the original file was not - * downloaded before. + * Save the given resource as an image on disk using the default image + * format for content. * * @param url - * the resource to open - * - * @return the opened resource image + * the resource + * @param target + * the target file * * @throws IOException * in case of I/O error @@ -357,7 +352,7 @@ public class Cache { * * @param uniqueID * the unique ID - * + * * @return the content or NULL */ public InputStream getFromCache(String uniqueID) { @@ -428,7 +423,6 @@ public class Cache { * * @throws IOException * in case of I/O error - * @throws URISyntaxException */ private void save(URL url, BasicSupport support, URL originalUrl) throws IOException { @@ -518,6 +512,7 @@ public class Cache { * * @param url * the url + * * @return the cached version if present, NULL if not */ private File getCached(URL url) { @@ -535,8 +530,9 @@ public class Cache { * Get the cache resource from the cache if it is present for this unique * ID. * - * @param url - * the url + * @param uniqueID + * the id + * * @return the cached version if present, NULL if not */ private File getCached(String uniqueID) { diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index 85d74928..a282e7cc 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -323,7 +323,7 @@ public class Main { * List the stories of the given type from the {@link Library} (unless NULL * is passed, in which case all stories will be listed). * - * @param typeString + * @param type * the type to list the known stories of, or NULL to list all * stories * diff --git a/src/be/nikiroo/fanfix/VersionCheck.java b/src/be/nikiroo/fanfix/VersionCheck.java index 3f63bf5e..be7fb919 100644 --- a/src/be/nikiroo/fanfix/VersionCheck.java +++ b/src/be/nikiroo/fanfix/VersionCheck.java @@ -12,6 +12,12 @@ import java.util.Map; import be.nikiroo.utils.Version; +/** + * Version checker: can check the current version of the program against a + * remote changelog, and list the missed updates and their description. + * + * @author niki + */ public class VersionCheck { private static final String url = "https://github.com/nikiroo/fanfix/raw/master/changelog.md"; diff --git a/src/be/nikiroo/fanfix/bundles/ConfigBundle.java b/src/be/nikiroo/fanfix/bundles/ConfigBundle.java index 9bf9dc69..7d38e368 100644 --- a/src/be/nikiroo/fanfix/bundles/ConfigBundle.java +++ b/src/be/nikiroo/fanfix/bundles/ConfigBundle.java @@ -11,6 +11,9 @@ import be.nikiroo.utils.resources.Bundle; * @author niki */ public class ConfigBundle extends Bundle { + /** + * Create a new {@link ConfigBundle}. + */ public ConfigBundle() { super(Config.class, Target.config); } diff --git a/src/be/nikiroo/fanfix/bundles/package-info.java b/src/be/nikiroo/fanfix/bundles/package-info.java index 50db0118..80cdd15f 100644 --- a/src/be/nikiroo/fanfix/bundles/package-info.java +++ b/src/be/nikiroo/fanfix/bundles/package-info.java @@ -1,6 +1,6 @@ /** * This package encloses the different - * {@link be.nikiroo.utils.resources.bundles.Bundle} and their associated + * {@link be.nikiroo.utils.resources.Bundle} and their associated * {@link java.lang.Enum}s used by the application. * * @author niki diff --git a/src/be/nikiroo/fanfix/data/Chapter.java b/src/be/nikiroo/fanfix/data/Chapter.java index 839d67b7..7d0a51b3 100644 --- a/src/be/nikiroo/fanfix/data/Chapter.java +++ b/src/be/nikiroo/fanfix/data/Chapter.java @@ -79,7 +79,7 @@ public class Chapter implements Iterable { /** * The included paragraphs. * - * @param paragraphes + * @param paragraphs * the paragraphs to set */ public void setParagraphs(List paragraphs) { diff --git a/src/be/nikiroo/fanfix/data/MetaData.java b/src/be/nikiroo/fanfix/data/MetaData.java index 189277d9..872baff2 100644 --- a/src/be/nikiroo/fanfix/data/MetaData.java +++ b/src/be/nikiroo/fanfix/data/MetaData.java @@ -235,7 +235,7 @@ public class MetaData implements Cloneable, Comparable { /** * A unique value representing the story in the local library. * - * @param uuid + * @param luid * the luid to set */ public void setLuid(String luid) { diff --git a/src/be/nikiroo/fanfix/data/Paragraph.java b/src/be/nikiroo/fanfix/data/Paragraph.java index e409c286..e4c94d45 100644 --- a/src/be/nikiroo/fanfix/data/Paragraph.java +++ b/src/be/nikiroo/fanfix/data/Paragraph.java @@ -33,11 +33,8 @@ public class Paragraph { /** * Create a new {@link Paragraph} with the given image. * - * @param support - * the support that will be used to fetch the image via - * {@link Paragraph#getContentImage()}. - * @param content - * the content image of this paragraph + * @param imageUrl + * the image as an URL */ public Paragraph(URL imageUrl) { this(ParagraphType.IMAGE, imageUrl.toString(), 0); diff --git a/src/be/nikiroo/fanfix/output/BasicOutput.java b/src/be/nikiroo/fanfix/output/BasicOutput.java index 1ac6101d..909c8fe9 100644 --- a/src/be/nikiroo/fanfix/output/BasicOutput.java +++ b/src/be/nikiroo/fanfix/output/BasicOutput.java @@ -94,7 +94,8 @@ public abstract class BasicOutput { } /** - * Call {@link OutputType#valueOf(String.toUpperCase())}. + * Call {@link OutputType#valueOf(String)} after conversion to upper + * case. * * @param typeName * the possible type name @@ -107,8 +108,9 @@ public abstract class BasicOutput { } /** - * Call {@link OutputType#valueOf(String.toUpperCase())} but return NULL - * for NULL and empty instead of raising an exception. + * Call {@link OutputType#valueOf(String)} after conversion to upper + * case but return NULL for NULL and empty instead of raising an + * exception. * * @param typeName * the possible type name @@ -124,8 +126,9 @@ public abstract class BasicOutput { } /** - * Call {@link OutputType#valueOf(String.toUpperCase())} but return NULL - * in case of error instead of raising an exception. + * Call {@link OutputType#valueOf(String)} after conversion to upper + * case but return NULL in case of error instead of raising an + * exception. * * @param typeName * the possible type name @@ -238,9 +241,10 @@ public abstract class BasicOutput { * * @param type * the new type - * @param infoCover - * TRUE to enable the creation of a .info file and a cover if - * possible + * @param writeInfo + * TRUE to enable the creation of a .info file + * @param writeCover + * TRUE to enable the creation of a cover if possible * * @return this */ diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport.java b/src/be/nikiroo/fanfix/supported/BasicSupport.java index 0de0c4aa..fbdb47a9 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport.java +++ b/src/be/nikiroo/fanfix/supported/BasicSupport.java @@ -106,7 +106,8 @@ public abstract class BasicSupport { } /** - * Call {@link SupportType#valueOf(String.toUpperCase())}. + * Call {@link SupportType#valueOf(String)} after conversion to upper + * case. * * @param typeName * the possible type name @@ -119,8 +120,8 @@ public abstract class BasicSupport { } /** - * Call {@link SupportType#valueOf(String.toUpperCase())} but return - * NULL for NULL instead of raising exception. + * Call {@link SupportType#valueOf(String)} after conversion to upper + * case but return NULL for NULL instead of raising exception. * * @param typeName * the possible type name @@ -136,8 +137,9 @@ public abstract class BasicSupport { } /** - * Call {@link SupportType#valueOf(String.toUpperCase())} but return - * NULL in case of error instead of raising an exception. + * Call {@link SupportType#valueOf(String)} after conversion to upper + * case but return NULL in case of error instead of raising an + * exception. * * @param typeName * the possible type name @@ -192,6 +194,19 @@ public abstract class BasicSupport { */ protected abstract boolean isHtml(); + /** + * Return the {@link MetaData} of this story. + * + * @param source + * the source of the story + * @param in + * the input (the main resource) + * + * @return the associated {@link MetaData} + * + * @throws IOException + * in case of I/O error + */ protected abstract MetaData getMeta(URL source, InputStream in) throws IOException; @@ -313,9 +328,10 @@ public abstract class BasicSupport { * * @param url * the story resource - * * @param close * close "this" and "in" when done + * @param getDesc + * retrieve the description of the story, or not * @param pg * the optional progress reporter * @@ -576,6 +592,8 @@ public abstract class BasicSupport { * Create a {@link Chapter} object from the given information, formatting * the content as it should be. * + * @param source + * the source of the story * @param number * the chapter number * @param name diff --git a/src/be/nikiroo/fanfix/supported/YiffStar.java b/src/be/nikiroo/fanfix/supported/YiffStar.java index a2126db5..9813df89 100644 --- a/src/be/nikiroo/fanfix/supported/YiffStar.java +++ b/src/be/nikiroo/fanfix/supported/YiffStar.java @@ -265,6 +265,7 @@ class YiffStar extends BasicSupport { * @return the {@link URL} * * @throws MalformedURLException + * in case of data error */ private URL guest(String link) throws MalformedURLException { if (link.contains("?")) { -- 2.27.0