20 package net.sf.gridarta.textedit.textarea.tokenmarker;
23 import java.util.HashMap;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
47 private static final Map<String, Class<? extends TokenMarker>>
TOKEN_MARKERS =
new HashMap<>();
82 final String filename = file.getName();
83 final int dotIndex = filename.lastIndexOf(
'.');
97 if (extension == null) {
101 final Class<? extends TokenMarker> tokenMarkerClass = TOKEN_MARKERS.get(extension);
102 if (tokenMarkerClass == null) {
106 return tokenMarkerClass.newInstance();
107 }
catch (
final InstantiationException ex) {
109 }
catch (
final IllegalAccessException ex) {
static TokenMarker createTokenMarker(@Nullable final File file)
Creates a suitable TokenMarker for a given file.
static final String DAIMONIN_AI
File extension for DaimoninAITokenMarker.
static final String CROSSFIRE_DIALOG
File extension for CrossfireDialogTokenMarker.
A TokenMarker for the message field of Crossfire objects allowing.
A factory for creatingTokenMarker instances for Files.
static final Map< String, Class<? extends TokenMarker > > TOKEN_MARKERS
Maps file extensions to token marker classes.
static TokenMarker createTokenMarker(@Nullable final String extension)
Creates a TokenMarker for a given file extension.
A TokenMarker for the message field of Daimonin AI objects.
TokenMarkerFactory()
Private constructor to prevent instantiation.
A token marker that splits lines of text into tokens.