Package com.vdurmont.emoji
Class EmojiLoader
- java.lang.Object
-
- com.vdurmont.emoji.EmojiLoader
-
public class EmojiLoader extends Object
Loads the emojis from a JSON database.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull Map<String,Emoji>loadEmojiBundle()Loads the emoji-definitions from the resources.static @NotNull List<Emoji>loadEmojis(@NotNull InputStream stream)Loads a JSONArray of emojis from an InputStream, parses it and returns the associated list ofEmojis.
-
-
-
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 ofEmojis.- Parameters:
stream- The stream of the JSONArray- Returns:
- The list of
Emojis - Throws:
NullPointerException- If the provided stream is nullorg.json.JSONException- If the json representation is invalidIOException- 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:
Mapof emoji characters to emoji instances- Throws:
IOException- If there is an I/O error when trying to read the resource file
-
-