com.nuecho.application.grammarserver.servlets
Class SingleJsonContextInitializer
java.lang.Object
com.nuecho.application.grammarserver.servlets.SingleJsonContextInitializer
- All Implemented Interfaces:
- ContextInitializer
public final class SingleJsonContextInitializer
- extends java.lang.Object
- implements ContextInitializer
Implementation of ContextInitializer that expects the "context" key,
in the parameterMap, to be a JSON string. That single string is converted to
a JSON value representing the whole instantiation context map, from which
keys and values are extracted to get the actual instantiation context.
- Version:
- 2.0.0
- See Also:
ContextInitializer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleJsonContextInitializer
public SingleJsonContextInitializer()
getContext
public java.util.Map getContext(java.util.Map parameteters,
GrammarFragmentFactory factory,
CacheControl control)
throws ContextInitializationException
- Description copied from interface:
ContextInitializer
- Computes an instantiation context from a map of parameters. Each
parameter name (a string) is bound to an array of values (an array of
Java strings).
- Specified by:
getContext in interface ContextInitializer
- Parameters:
parameteters - the input parametersfactory - a grammar fragment factory objectcontrol - a cache control object
- Returns:
- the instantiation context that maps strings to objects.
- Throws:
ContextInitializationException - when an error occurs during the
building of the instantiation context