Package org.fife.ui.rsyntaxtextarea
Class AbstractTokenMakerFactory
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.TokenMakerFactory
-
- org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory
-
public abstract class AbstractTokenMakerFactory extends TokenMakerFactory
Base class forTokenMakerFactory
implementations. A mapping from language keys to the names ofTokenMaker
classes is stored.
-
-
Field Summary
-
Fields inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTokenMakerFactory()
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TokenMaker
getTokenMakerImpl(String key)
Returns aTokenMaker
for the specified key.protected abstract void
initTokenMakerMap()
Populates the mapping from keys to instances ofTokenMakerCreator
s.Set<String>
keySet()
Returns the set of keys that this factory maps to token makers.void
putMapping(String key, String className)
Adds a mapping from a key to aTokenMaker
implementation class name.void
putMapping(String key, String className, ClassLoader cl)
Adds a mapping from a key to aTokenMaker
implementation class name.-
Methods inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
getDefaultInstance, getTokenMaker, setDefaultInstance
-
-
-
-
Method Detail
-
getTokenMakerImpl
protected TokenMaker getTokenMakerImpl(String key)
Returns aTokenMaker
for the specified key.- Specified by:
getTokenMakerImpl
in classTokenMakerFactory
- Parameters:
key
- The key.- Returns:
- The corresponding
TokenMaker
, ornull
if none matches the specified key.
-
initTokenMakerMap
protected abstract void initTokenMakerMap()
Populates the mapping from keys to instances ofTokenMakerCreator
s. Subclasses should override this method and call one of theputMapping
overloads to registerTokenMaker
s for syntax constants.
-
keySet
public Set<String> keySet()
Returns the set of keys that this factory maps to token makers.- Specified by:
keySet
in classTokenMakerFactory
- Returns:
- The set of keys.
-
putMapping
public void putMapping(String key, String className)
Adds a mapping from a key to aTokenMaker
implementation class name.- Parameters:
key
- The key.className
- TheTokenMaker
class name.- See Also:
putMapping(String, String, ClassLoader)
-
putMapping
public void putMapping(String key, String className, ClassLoader cl)
Adds a mapping from a key to aTokenMaker
implementation class name.- Parameters:
key
- The key.className
- TheTokenMaker
class name.cl
- The class loader to use when loading the class.- See Also:
putMapping(String, String)
-
-