projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a448427
)
Add javadoc comments, remove obsolete imports.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Wed, 8 Jun 2011 10:26:49 +0000
(12:26 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Wed, 8 Jun 2011 10:26:49 +0000
(12:26 +0200)
src/main/java/net/pterodactylus/sone/text/FreenetLinkPart.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/text/LinkPart.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/text/PostPart.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/text/SonePart.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/text/SoneTextParser.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/text/FreenetLinkPart.java
b/src/main/java/net/pterodactylus/sone/text/FreenetLinkPart.java
index
2efb380
..
be3aef9
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/FreenetLinkPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/FreenetLinkPart.java
@@
-18,23
+18,57
@@
package net.pterodactylus.sone.text;
/**
package net.pterodactylus.sone.text;
/**
- * TODO
+ * {@link LinkPart} implementation that stores an additional attribute: if the
+ * link is an SSK or USK link and the post was created by an identity that owns
+ * the keyspace in question.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class FreenetLinkPart extends LinkPart {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class FreenetLinkPart extends LinkPart {
+ /** Whether the link is trusted. */
private final boolean trusted;
private final boolean trusted;
+ /**
+ * Creates a new freenet link part.
+ *
+ * @param link
+ * The link of the part
+ * @param text
+ * The text of the part
+ * @param trusted
+ * {@code true} if the link is trusted, {@code false} otherwise
+ */
public FreenetLinkPart(String link, String text, boolean trusted) {
this(link, text, text, trusted);
}
public FreenetLinkPart(String link, String text, boolean trusted) {
this(link, text, text, trusted);
}
+ /**
+ * Creates a new freenet link part.
+ *
+ * @param link
+ * The link of the part
+ * @param text
+ * The text of the part
+ * @param title
+ * The title of the part
+ * @param trusted
+ * {@code true} if the link is trusted, {@code false} otherwise
+ */
public FreenetLinkPart(String link, String text, String title, boolean trusted) {
super(link, text, title);
this.trusted = trusted;
}
public FreenetLinkPart(String link, String text, String title, boolean trusted) {
super(link, text, title);
this.trusted = trusted;
}
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns whether the link is trusted.
+ *
+ * @return {@code true} if the link is trusted, {@code false} otherwise
+ */
public boolean isTrusted() {
return trusted;
}
public boolean isTrusted() {
return trusted;
}
diff --git
a/src/main/java/net/pterodactylus/sone/text/LinkPart.java
b/src/main/java/net/pterodactylus/sone/text/LinkPart.java
index
d911bbd
..
d5da730
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/LinkPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/LinkPart.java
@@
-18,20
+18,45
@@
package net.pterodactylus.sone.text;
/**
package net.pterodactylus.sone.text;
/**
- * TODO
+ * {@link Part} implementation that can hold a link. A link contains of three
+ * attributes: the link itself, the text that is shown instead of the link, and
+ * an explanatory text that can be displayed e.g. as a tooltip.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class LinkPart implements Part {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class LinkPart implements Part {
+ /** The link of this part. */
private final String link;
private final String link;
+
+ /** The text of this part. */
private final String text;
private final String text;
+
+ /** The title of this part. */
private final String title;
private final String title;
+ /**
+ * Creates a new link part.
+ *
+ * @param link
+ * The link of the link part
+ * @param text
+ * The text of the link part
+ */
public LinkPart(String link, String text) {
this(link, text, text);
}
public LinkPart(String link, String text) {
this(link, text, text);
}
+ /**
+ * Creates a new link part.
+ *
+ * @param link
+ * The link of the link part
+ * @param text
+ * The text of the link part
+ * @param title
+ * The title of the link part
+ */
public LinkPart(String link, String text, String title) {
this.link = link;
this.text = text;
public LinkPart(String link, String text, String title) {
this.link = link;
this.text = text;
@@
-42,14
+67,29
@@
public class LinkPart implements Part {
// ACCESSORS
//
// ACCESSORS
//
+ /**
+ * Returns the link of this part.
+ *
+ * @return The link of this part
+ */
public String getLink() {
return link;
}
public String getLink() {
return link;
}
+ /**
+ * Returns the text of this part.
+ *
+ * @return The text of this part
+ */
public String getText() {
return text;
}
public String getText() {
return text;
}
+ /**
+ * Returns the title of this part.
+ *
+ * @return The title of this part
+ */
public String getTitle() {
return title;
}
public String getTitle() {
return title;
}
diff --git
a/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
b/src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
index
4870bc4
..
a1f2088
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/PlainTextPart.java
@@
-17,21
+17,22
@@
package net.pterodactylus.sone.text;
package net.pterodactylus.sone.text;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-
-import net.pterodactylus.util.collection.ObjectIterator;
-
/**
/**
- *
TODO
+ *
{@link Part} implementation that holds a single piece of text.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class PlainTextPart implements Part {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class PlainTextPart implements Part {
+ /** The text of the part. */
private final String text;
private final String text;
+ /**
+ * Creates a new plain-text part.
+ *
+ * @param text
+ * The text of the part
+ */
public PlainTextPart(String text) {
this.text = text;
}
public PlainTextPart(String text) {
this.text = text;
}
@@
-40,6
+41,11
@@
public class PlainTextPart implements Part {
// ACCESSORS
//
// ACCESSORS
//
+ /**
+ * Returns the text of this part.
+ *
+ * @return The text of this part
+ */
public String getText() {
return text;
}
public String getText() {
return text;
}
diff --git
a/src/main/java/net/pterodactylus/sone/text/PostPart.java
b/src/main/java/net/pterodactylus/sone/text/PostPart.java
index
1e0773d
..
22acd43
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/PostPart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/PostPart.java
@@
-20,18
+20,34
@@
package net.pterodactylus.sone.text;
import net.pterodactylus.sone.data.Post;
/**
import net.pterodactylus.sone.data.Post;
/**
- *
TODO
+ *
{@link Part} implementation that stores a reference to a {@link Post}.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class PostPart implements Part {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class PostPart implements Part {
+ /** The post this part refers to. */
private final Post post;
private final Post post;
+ /**
+ * Creates a new post part.
+ *
+ * @param post
+ * The referenced post
+ */
public PostPart(Post post) {
this.post = post;
}
public PostPart(Post post) {
this.post = post;
}
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the post referenced by this part.
+ *
+ * @return The post referenced by this part
+ */
public Post getPost() {
return post;
}
public Post getPost() {
return post;
}
diff --git
a/src/main/java/net/pterodactylus/sone/text/SonePart.java
b/src/main/java/net/pterodactylus/sone/text/SonePart.java
index
b460a29
..
5c6a63d
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/SonePart.java
+++ b/
src/main/java/net/pterodactylus/sone/text/SonePart.java
@@
-18,21
+18,36
@@
package net.pterodactylus.sone.text;
import net.pterodactylus.sone.data.Sone;
package net.pterodactylus.sone.text;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.template.SoneAccessor;
/**
/**
- *
TODO
+ *
{@link Part} implementation that stores a reference to a {@link Sone}.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class SonePart implements Part {
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class SonePart implements Part {
+ /** The referenced {@link Sone}. */
private final Sone sone;
private final Sone sone;
+ /**
+ * Creates a new Sone part.
+ *
+ * @param sone
+ * The referenced Sone
+ */
public SonePart(Sone sone) {
this.sone = sone;
}
public SonePart(Sone sone) {
this.sone = sone;
}
+ //
+ // ACCESSORS
+ //
+
+ /**
+ * Returns the referenced Sone.
+ *
+ * @return The referenced Sone
+ */
public Sone getSone() {
return sone;
}
public Sone getSone() {
return sone;
}
diff --git
a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java
b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java
index
dede0ac
..
68a32d0
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/text/SoneTextParser.java
+++ b/
src/main/java/net/pterodactylus/sone/text/SoneTextParser.java
@@
-20,10
+20,7
@@
package net.pterodactylus.sone.text;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
-import java.io.StringReader;
-import java.io.Writer;
import java.net.MalformedURLException;
import java.net.MalformedURLException;
-import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
@@
-32,11
+29,7
@@
import java.util.regex.Pattern;
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.template.SoneAccessor;
import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.logging.Logging;
-import net.pterodactylus.util.template.Template;
-import net.pterodactylus.util.template.TemplateContextFactory;
-import net.pterodactylus.util.template.TemplateParser;
import freenet.keys.FreenetURI;
/**
import freenet.keys.FreenetURI;
/**