Package org.fife.ui.rsyntaxtextarea
Class AbstractTokenMakerFactory
java.lang.Object
org.fife.ui.rsyntaxtextarea.TokenMakerFactory
org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory
- Direct Known Subclasses:
DefaultTokenMakerFactory
Base class for
TokenMakerFactory
implementations. A mapping from
language keys to the names of TokenMaker
classes is stored.- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Wrapper that handles the creation of TokenMaker instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionA mapping from keys to the names ofTokenMaker
implementation class names.Fields inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TokenMaker
getTokenMakerImpl
(String key) Returns aTokenMaker
for the specified key.protected abstract void
Populates the mapping from keys to instances ofTokenMakerCreator
s.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
-
Field Details
-
tokenMakerMap
A mapping from keys to the names ofTokenMaker
implementation class names. WhenTokenMakerFactory.getTokenMaker(String)
is called with a key defined in this map, aTokenMaker
of the corresponding type is returned.
-
-
Constructor Details
-
AbstractTokenMakerFactory
protected AbstractTokenMakerFactory()Constructor.
-
-
Method Details
-
getTokenMakerImpl
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.- See Also:
-
keySet
Description copied from class:TokenMakerFactory
Returns the set of keys that this factory maps to token makers.- Specified by:
keySet
in classTokenMakerFactory
- Returns:
- The set of keys.
-
putMapping
Adds a mapping from a key to aTokenMaker
implementation class name.- Parameters:
key
- The key.className
- TheTokenMaker
class name.- See Also:
-
putMapping
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:
-