import java.io.IOException;
import java.io.Reader;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
/**
* Interface for parsers that can create {@link Part}s from a text source
* The text source
* @return The parsed parts
*/
- public Iterable<Part> parse(C context, String source);
+ @Nonnull
+ Iterable<Part> parse(@Nullable C context, @Nonnull String source);
}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.impl.IdOnlySone;
/**
* {@inheritDoc}
*/
+ @Nonnull
@Override
- public Iterable<Part> parse(SoneTextParserContext context, String source) {
+ public Iterable<Part> parse(@Nullable SoneTextParserContext context, @Nonnull String source) {
PartContainer parts = new PartContainer();
BufferedReader bufferedReader = new BufferedReader(new StringReader(source));
try {