org.fife.ui.rsyntaxtextarea
Class AbstractTokenMakerFactory

java.lang.Object
  extended by org.fife.ui.rsyntaxtextarea.TokenMakerFactory
      extended by org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory

public abstract class AbstractTokenMakerFactory
extends TokenMakerFactory

Base class for TokenMakerFactory implementations. A java.util.Map maps keys to the names of TokenMaker classes.

Version:
1.0
Author:
Robert Futrell

Field Summary
 
Fields inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
 
Constructor Summary
protected AbstractTokenMakerFactory()
          Constructor.
 
Method Summary
protected abstract  Map createTokenMakerKeyToClassNameMap()
          Creates and returns a mapping from keys to the names of TokenMaker implementation classes.
protected  TokenMaker getTokenMakerImpl(String key)
          Returns a TokenMaker for the specified key.
 Set keySet()
          Returns the set of keys that this factory maps to token makers.
 String putMapping(String key, String className)
          Adds a mapping from a key to a TokenMaker implementation class name.
 
Methods inherited from class org.fife.ui.rsyntaxtextarea.TokenMakerFactory
getDefaultInstance, getTokenMaker, setDefaultInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTokenMakerFactory

protected AbstractTokenMakerFactory()
Constructor.

Method Detail

createTokenMakerKeyToClassNameMap

protected abstract Map createTokenMakerKeyToClassNameMap()
Creates and returns a mapping from keys to the names of TokenMaker implementation classes. When TokenMakerFactory.getTokenMaker(String) is called with a key defined in this map, a TokenMaker of the corresponding type is returned.

Specified by:
createTokenMakerKeyToClassNameMap in class TokenMakerFactory
Returns:
The map.

getTokenMakerImpl

protected TokenMaker getTokenMakerImpl(String key)
Returns a TokenMaker for the specified key.

Specified by:
getTokenMakerImpl in class TokenMakerFactory
Parameters:
key - The key.
Returns:
The corresponding TokenMaker, or null if none matches the specified key.

keySet

public Set keySet()
Returns the set of keys that this factory maps to token makers. return The set of keys.

Specified by:
keySet in class TokenMakerFactory

putMapping

public String putMapping(String key,
                         String className)
Adds a mapping from a key to a TokenMaker implementation class name.

Parameters:
key - The key.
className - The TokenMaker class name.
Returns:
The previous value for the specified key, or null if there was none.