TokenMakerFactory
Date: 2017-02-11

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 to `TokenMaker`s capable of splitting text into tokens for those syntax styles.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.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 Summary

    Constructors
    Constructor and Description
    `TokenMakerFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TokenMakerFactory` | `getDefaultInstance()` Returns the default `TokenMakerFactory` instance.
    `TokenMaker` | `getTokenMaker(java.lang.String key)` Returns a `TokenMaker` for the specified key.
    `protected abstract TokenMaker` | `getTokenMakerImpl(java.lang.String key)` Returns a `TokenMaker` 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 default `TokenMakerFactory` instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 custom `TokenMakerFactory` of the specified class will be used as the default token maker factory.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TokenMakerFactory

          public TokenMakerFactory()

  - ### Method Detail

    - #### getDefaultInstance

          public static TokenMakerFactory getDefaultInstance()

      Returns the default `TokenMakerFactory` instance. This is the factory used by all `RSyntaxDocument`s by default.
      Returns:
        The factory.
      See Also:
        `setDefaultInstance(TokenMakerFactory)`

    - #### getTokenMaker

          public final TokenMaker getTokenMaker(java.lang.String key)

      Returns a `TokenMaker` for the specified key.
      Parameters:
        `key` - The key.
      Returns:
        The corresponding `TokenMaker`, or `PlainTextTokenMaker` if none matches the specified key.

    - #### getTokenMakerImpl

          protected abstract TokenMaker getTokenMakerImpl(java.lang.String key)

      Returns a `TokenMaker` for the specified key.
      Parameters:
        `key` - The key.
      Returns:
        The corresponding `TokenMaker`, or `null` 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 default `TokenMakerFactory` instance. This is the factory used by all future `RSyntaxDocument`s by default. `RSyntaxDocument`s that have already been created are not affected.
      Parameters:
        `tmf` - The factory.
      Throws:
        `java.lang.IllegalArgumentException` - If `tmf` is `null`.
      See Also:
        `getDefaultInstance()`