Clean up parser interface
[Sone.git] / src / main / java / net / pterodactylus / sone / text / Parser.java
index 87cdab5..ca26a79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - Parser.java - Copyright © 2010 David Roden
+ * Sone - Parser.java - Copyright © 2010–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,8 @@ package net.pterodactylus.sone.text;
 
 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
@@ -38,9 +40,8 @@ public interface Parser<C extends ParserContext> {
         * @param source
         *            The text source
         * @return The parsed parts
-        * @throws IOException
-        *             if an I/O error occurs
         */
-       public Iterable<Part> parse(C context, Reader source) throws IOException;
+       @Nonnull
+       Iterable<Part> parse(@Nullable C context, @Nonnull String source);
 
 }