public abstract class TokenMakerFactory extends Object
TokenMakers capable of splitting
text into tokens for those syntax styles.| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
If this system property is set, a custom
TokenMakerFactory
of the specified class will be used as the default token maker factory. |
| Constructor and Description |
|---|
TokenMakerFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map |
createTokenMakerKeyToClassNameMap()
Creates and returns a mapping from keys to the names of
TokenMaker implementation classes. |
static TokenMakerFactory |
getDefaultInstance()
Returns the default
TokenMakerFactory instance. |
TokenMaker |
getTokenMaker(String key)
Returns a
TokenMaker for the specified key. |
protected abstract TokenMaker |
getTokenMakerImpl(String key)
Returns a
TokenMaker for the specified key. |
abstract Set |
keySet()
Returns the set of keys that this factory maps to token makers.
|
static void |
setDefaultInstance(TokenMakerFactory tmf)
Sets the default
TokenMakerFactory instance. |
public static final String PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
TokenMakerFactory
of the specified class will be used as the default token maker factory.protected abstract Map createTokenMakerKeyToClassNameMap()
TokenMaker implementation classes. When
getTokenMaker(String) is called with a key defined in this
map, a TokenMaker of the corresponding type is returned.public static TokenMakerFactory getDefaultInstance()
TokenMakerFactory instance. This is
the factory used by all RSyntaxDocuments by default.setDefaultInstance(TokenMakerFactory)public final TokenMaker getTokenMaker(String key)
TokenMaker for the specified key.key - The key.TokenMaker, or
PlainTextTokenMaker if none matches the specified key.protected abstract TokenMaker getTokenMakerImpl(String key)
TokenMaker for the specified key.key - The key.TokenMaker, or null
if none matches the specified key.public abstract Set keySet()
public static void setDefaultInstance(TokenMakerFactory tmf)
TokenMakerFactory instance. This is
the factory used by all future RSyntaxDocuments by default.
RSyntaxDocuments that have already been created are not
affected.tmf - The factory.IllegalArgumentException - If tmf is
null.getDefaultInstance()Copyright © 2009-2013 jtstand.com. All Rights Reserved.