Package org.fife.ui.rsyntaxtextarea
Class TokenMakerFactory
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.TokenMakerFactory
-
- Direct Known Subclasses:
AbstractTokenMakerFactory
public abstract class TokenMakerFactory extends java.lang.Object
A factory that maps syntax styles toTokenMaker
s capable of splitting text into tokens for those syntax styles.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private static TokenMakerFactory
DEFAULT_INSTANCE
The singleton defaultTokenMakerFactory
instance.static java.lang.String
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
If this system property is set, a customTokenMakerFactory
of 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 TokenMakerFactory
getDefaultInstance()
Returns the defaultTokenMakerFactory
instance.TokenMaker
getTokenMaker(java.lang.String key)
Returns aTokenMaker
for the specified key.protected abstract TokenMaker
getTokenMakerImpl(java.lang.String key)
Returns aTokenMaker
for the specified key.abstract java.util.Set<java.lang.String>
keySet()
Returns the set of keys that this factory maps to token makers.static void
setDefaultInstance(TokenMakerFactory tmf)
Sets the defaultTokenMakerFactory
instance.
-
-
-
Field Detail
-
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
public static final java.lang.String PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
If this system property is set, a customTokenMakerFactory
of the specified class will be used as the default token maker factory.- See Also:
- Constant Field Values
-
DEFAULT_INSTANCE
private static TokenMakerFactory DEFAULT_INSTANCE
The singleton defaultTokenMakerFactory
instance.
-
-
Method Detail
-
getDefaultInstance
public static TokenMakerFactory getDefaultInstance()
Returns the defaultTokenMakerFactory
instance. This is the factory used by allRSyntaxDocument
s by default.- Returns:
- The factory.
- See Also:
setDefaultInstance(TokenMakerFactory)
-
getTokenMaker
public final TokenMaker getTokenMaker(java.lang.String key)
Returns aTokenMaker
for the specified key.- Parameters:
key
- The key.- Returns:
- The corresponding
TokenMaker
, orPlainTextTokenMaker
if none matches the specified key.
-
getTokenMakerImpl
protected abstract TokenMaker getTokenMakerImpl(java.lang.String key)
Returns aTokenMaker
for the specified key.- Parameters:
key
- The key.- Returns:
- The corresponding
TokenMaker
, ornull
if none matches the specified key.
-
keySet
public abstract java.util.Set<java.lang.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 defaultTokenMakerFactory
instance. This is the factory used by all futureRSyntaxDocument
s by default.RSyntaxDocument
s that have already been created are not affected.- Parameters:
tmf
- The factory.- Throws:
java.lang.IllegalArgumentException
- Iftmf
isnull
.- See Also:
getDefaultInstance()
-
-