X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FParser.java;h=ca26a790a3aba92b1ce63a202163c30b76709c8a;hb=16b7ecd68873178d79b81023fc702d61d7696e13;hp=3fef8ae997e60a8550555c6a01ef01b70af8a7c0;hpb=ab7fada54ed08b0a8d9ce9c606cbea29c3c3f819;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/text/Parser.java b/src/main/java/net/pterodactylus/sone/text/Parser.java index 3fef8ae..ca26a79 100644 --- a/src/main/java/net/pterodactylus/sone/text/Parser.java +++ b/src/main/java/net/pterodactylus/sone/text/Parser.java @@ -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 @@ -31,16 +33,15 @@ import java.io.Reader; public interface Parser { /** - * Create a {@link Part} from the given text source. + * Create one or more {@link Part}s from the given text source. * * @param context - * The parser context + * The parser context (may be {@code null}) * @param source * The text source - * @return The parsed part - * @throws IOException - * if an I/O error occurs + * @return The parsed parts */ - public Iterable parse(C context, Reader source) throws IOException; + @Nonnull + Iterable parse(@Nullable C context, @Nonnull String source); }