Class EmojiLoader


  • public class EmojiLoader
    extends Object
    Loads the emojis from a JSON database.
    • Method Detail

      • loadEmojis

        @NotNull
        public static @NotNull List<Emoji> loadEmojis​(@NotNull
                                                      @NotNull InputStream stream)
                                               throws IOException
        Loads a JSONArray of emojis from an InputStream, parses it and returns the associated list of Emojis.
        Parameters:
        stream - The stream of the JSONArray
        Returns:
        The list of Emojis
        Throws:
        NullPointerException - If the provided stream is null
        org.json.JSONException - If the json representation is invalid
        IOException - If an error occurs while reading the stream or parsing the JSONArray
      • loadEmojiBundle

        @NotNull
        public static @NotNull Map<String,​Emoji> loadEmojiBundle()
                                                                throws IOException
        Loads the emoji-definitions from the resources.
        Returns:
        Map of emoji characters to emoji instances
        Throws:
        IOException - If there is an I/O error when trying to read the resource file