From d683cae6ffe644a9f63eea6cf3b7e59d2bde617b Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 21 Dec 2017 02:16:34 -0500 Subject: Enhancement/fragment interface (#564) * Begin fragment interfaces and themable contracts * Prepare swiperefresh interface * Snapshot * Add compilable version * Revamp once more * Finalize layouts * Cleanup --- app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt b/app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt index 9e247f1e..186633e5 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/parsers/FrostParser.kt @@ -10,6 +10,8 @@ import org.jsoup.nodes.Document * * In all cases, parsing will be done from a JSoup document * Variants accepting strings are also permitted, and they will be converted to documents accordingly + * The return type must be nonnull if no parsing errors occurred, as null signifies a parse error + * If null really must be allowed, use Optionals */ interface FrostParser { /** @@ -37,6 +39,7 @@ interface FrostParser { } internal abstract class FrostParserBase : FrostParser { + override final fun parse(text: String?): T? { text ?: return null val doc = textToDoc(text) ?: return null -- cgit v1.2.3