Package org.fife.ui.rsyntaxtextarea
Class AbstractTokenMakerFactory
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.TokenMakerFactory
-
- org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory
-
- Direct Known Subclasses:
DefaultTokenMakerFactory
public abstract class AbstractTokenMakerFactory extends TokenMakerFactory
Base class forTokenMakerFactoryimplementations. A mapping from language keys to the names ofTokenMakerclasses is stored.- Version:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAbstractTokenMakerFactory.TokenMakerCreatorWrapper that handles the creation of TokenMaker instances.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.Object>tokenMakerMapA mapping from keys to the names ofTokenMakerimplementation class names.-
Fields inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTokenMakerFactory()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TokenMakergetTokenMakerImpl(java.lang.String key)Returns aTokenMakerfor the specified key.protected abstract voidinitTokenMakerMap()Populates the mapping from keys to instances ofTokenMakerCreators.java.util.Set<java.lang.String>keySet()Returns the set of keys that this factory maps to token makers.voidputMapping(java.lang.String key, java.lang.String className)Adds a mapping from a key to aTokenMakerimplementation class name.voidputMapping(java.lang.String key, java.lang.String className, java.lang.ClassLoader cl)Adds a mapping from a key to aTokenMakerimplementation class name.-
Methods inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
getDefaultInstance, getTokenMaker, setDefaultInstance
-
-
-
-
Field Detail
-
tokenMakerMap
private java.util.Map<java.lang.String,java.lang.Object> tokenMakerMap
A mapping from keys to the names ofTokenMakerimplementation class names. WhenTokenMakerFactory.getTokenMaker(String)is called with a key defined in this map, aTokenMakerof the corresponding type is returned.
-
-
Method Detail
-
getTokenMakerImpl
protected TokenMaker getTokenMakerImpl(java.lang.String key)
Returns aTokenMakerfor the specified key.- Specified by:
getTokenMakerImplin classTokenMakerFactory- Parameters:
key- The key.- Returns:
- The corresponding
TokenMaker, ornullif none matches the specified key.
-
initTokenMakerMap
protected abstract void initTokenMakerMap()
Populates the mapping from keys to instances ofTokenMakerCreators. Subclasses should override this method and call one of theputMappingoverloads to registerTokenMakers for syntax constants.
-
keySet
public java.util.Set<java.lang.String> keySet()
Description copied from class:TokenMakerFactoryReturns the set of keys that this factory maps to token makers.- Specified by:
keySetin classTokenMakerFactory- Returns:
- The set of keys.
-
putMapping
public void putMapping(java.lang.String key, java.lang.String className)Adds a mapping from a key to aTokenMakerimplementation class name.- Parameters:
key- The key.className- TheTokenMakerclass name.- See Also:
putMapping(String, String, ClassLoader)
-
putMapping
public void putMapping(java.lang.String key, java.lang.String className, java.lang.ClassLoader cl)Adds a mapping from a key to aTokenMakerimplementation class name.- Parameters:
key- The key.className- TheTokenMakerclass name.cl- The class loader to use when loading the class.- See Also:
putMapping(String, String)
-
-