X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FParser.java;h=f87b852586cb975f3933a0d3491ab4c98b3fa3aa;hp=e43ed47566f490f2aa850f41d2bcfb0a919b5280;hb=15f4c53dd87e07b452a04ec2d0e022197e09bd92;hpb=915e48ef36a444907c00e818c8215db172c089a6 diff --git a/src/main/java/net/pterodactylus/sone/text/Parser.java b/src/main/java/net/pterodactylus/sone/text/Parser.java index e43ed47..f87b852 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–2016 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 @@ -17,8 +17,9 @@ 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 +32,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 * @param source * The text source - * @return The parsed part - * @throws IOException - * if an I/O error occurs + * @param context + * The parser context (may be {@code null}) + * @return The parsed parts */ - public Part parse(C context, Reader source) throws IOException; + @Nonnull + Iterable parse(@Nonnull String source, @Nullable C context); }