public abstract class AbstractTokenMakerFactory extends TokenMakerFactory
TokenMakerFactory
implementations. A mapping from
language keys to the names of TokenMaker
classes is stored.PROPERTY_DEFAULT_TOKEN_MAKER_FACTORY
限定符 | 构造器和说明 |
---|---|
protected |
AbstractTokenMakerFactory()
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
protected TokenMaker |
getTokenMakerImpl(java.lang.String key)
Returns a
TokenMaker for the specified key. |
protected abstract void |
initTokenMakerMap()
Populates the mapping from keys to instances of
TokenMakerCreator s. |
java.util.Set<java.lang.String> |
keySet()
Returns the set of keys that this factory maps to token makers.
|
void |
putMapping(java.lang.String key,
java.lang.String className)
Adds a mapping from a key to a
TokenMaker implementation
class name. |
void |
putMapping(java.lang.String key,
java.lang.String className,
java.lang.ClassLoader cl)
Adds a mapping from a key to a
TokenMaker implementation
class name. |
getDefaultInstance, getTokenMaker, setDefaultInstance
protected TokenMaker getTokenMakerImpl(java.lang.String key)
TokenMaker
for the specified key.getTokenMakerImpl
在类中 TokenMakerFactory
key
- The key.TokenMaker
, or null
if none matches the specified key.protected abstract void initTokenMakerMap()
TokenMakerCreator
s. Subclasses should override this method
and call one of the putMapping
overloads to register
TokenMaker
s for syntax constants.public java.util.Set<java.lang.String> keySet()
keySet
在类中 TokenMakerFactory
public void putMapping(java.lang.String key, java.lang.String className)
TokenMaker
implementation
class name.key
- The key.className
- The TokenMaker
class name.putMapping(String, String, ClassLoader)
public void putMapping(java.lang.String key, java.lang.String className, java.lang.ClassLoader cl)
TokenMaker
implementation
class name.key
- The key.className
- The TokenMaker
class name.cl
- The class loader to use when loading the class.putMapping(String, String)