Package org.fife.ui.rsyntaxtextarea
Class TokenMakerFactory
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.TokenMakerFactory
-
- Direct Known Subclasses:
AbstractTokenMakerFactory
public abstract class TokenMakerFactory extends Object
A factory that maps syntax styles toTokenMakers capable of splitting text into tokens for those syntax styles.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROPERTY_DEFAULT_TOKEN_MAKER_FACTORYIf this system property is set, a customTokenMakerFactoryof the specified class will be used as the default token maker factory.
-
Constructor Summary
Constructors Constructor Description TokenMakerFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TokenMakerFactorygetDefaultInstance()Returns the defaultTokenMakerFactoryinstance.TokenMakergetTokenMaker(String key)Returns aTokenMakerfor the specified key.protected abstract TokenMakergetTokenMakerImpl(String key)Returns aTokenMakerfor the specified key.abstract Set<String>keySet()Returns the set of keys that this factory maps to token makers.static voidsetDefaultInstance(TokenMakerFactory tmf)Sets the defaultTokenMakerFactoryinstance.
-
-
-
Field Detail
-
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
public static final String PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
If this system property is set, a customTokenMakerFactoryof the specified class will be used as the default token maker factory.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultInstance
public static TokenMakerFactory getDefaultInstance()
Returns the defaultTokenMakerFactoryinstance. This is the factory used by allRSyntaxDocuments by default.- Returns:
- The factory.
- See Also:
setDefaultInstance(TokenMakerFactory)
-
getTokenMaker
public final TokenMaker getTokenMaker(String key)
Returns aTokenMakerfor the specified key.- Parameters:
key- The key.- Returns:
- The corresponding
TokenMaker, orPlainTextTokenMakerif none matches the specified key.
-
getTokenMakerImpl
protected abstract TokenMaker getTokenMakerImpl(String key)
Returns aTokenMakerfor the specified key.- Parameters:
key- The key.- Returns:
- The corresponding
TokenMaker, ornullif none matches the specified key.
-
keySet
public abstract Set<String> keySet()
Returns the set of keys that this factory maps to token makers.- Returns:
- The set of keys.
-
setDefaultInstance
public static void setDefaultInstance(TokenMakerFactory tmf)
Sets the defaultTokenMakerFactoryinstance. This is the factory used by all futureRSyntaxDocuments by default.RSyntaxDocuments that have already been created are not affected.- Parameters:
tmf- The factory.- Throws:
IllegalArgumentException- Iftmfisnull.- See Also:
getDefaultInstance()
-
-